GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Operating System  >  Shell Scripting
Go To First  |  Previous Question  |  Next Question 
 Shell Scripting  |  Question 36 of 47    Print  
write a script to convert all dos style backslashes to unix style slashes in a list of files?
write a script to list all the differences between two directories ?
what is the command for to display the last newly appending lines of a file during appending data to the same file by same processes ?
what is the command to display top most processes which has utilised most of the cpu?

  
Total Answers and Comments: 7 Last Update: September 07, 2009     Asked by: ashok 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
December 22, 2007 00:15:13   #1  
prasul Member Since: December 2007   Contribution: 6    

RE: write a script to convert all dos style backslashes to unix style slashes in a list of files?write a script to list all the differences between two directories ?what is the command for to display the last newly appending lines of a file during appendi
for i in `ls *`;do cat $i|sed 'y|\|/|' > $i.newthis will create a new file for each of the replace files so remove the .new line to get the same updated.tail -f filenameshould display the updates made to a file.top -c -d2 should list the processes based on the current usage.
 
Is this answer useful? Yes | No
January 08, 2008 08:28:38   #2  
amitbhosale Member Since: October 2007   Contribution: 6    

RE:what is the command to display top most processes which has utilised most of the cpu?
you can use this command to display top most processes which has utilised most of the cpu.

ps aux | sort -n +2 | tail -1

 
Is this answer useful? Yes | No
April 30, 2008 16:17:44   #3  
gattu Member Since: April 2008   Contribution: 1    

RE: write a script to convert all dos style backslashes to unix style slashes in a list of files?write a script to list all the differences between two directories ?what is the command for to display the last newly appending lines of a file during appendi
lets say window.list has the file list
then this will do the trick

cat window.list | sed 's///\/g'

 
Is this answer useful? Yes | No
August 13, 2008 06:55:53   #4  
me_ruc Member Since: August 2008   Contribution: 1    

RE: write a script to convert all dos style backslashes to unix style slashes in a list of files?write a script to list all the differences between two directories ?what is the command for to display the last newly appending lines of a file during appendi
You can simply use dos2unix command which allow you to change all window special character to Unix format.
 
Is this answer useful? Yes | No
June 09, 2009 20:02:07   #5  
venkat75 Member Since: June 2009   Contribution: 1    

RE: what is the command for to display the last newly appending lines of a file during appending data to the same file by same processes ?
Command to display newly appended lines
tail -f filename

 
Is this answer useful? Yes | No
June 17, 2009 09:21:56   #6  
amitkshirsagar Member Since: June 2009   Contribution: 3    

RE: write a script to convert all dos style backslashes to unix style slashes in a list of files?write a script to list all the differences between two directories ?what is the command for to display the last newly appending lines of a file during appendi
Command to list all the differences between two dir:

diff -r > diff.txt

Diff.txt will show you all the differences.

 
Is this answer useful? Yes | No
September 07, 2009 16:04:11   #7  
sorkan Member Since: September 2009   Contribution: 1    

RE: write a script to convert all dos style backslashes to unix style slashes in a list of files?write a script to list all the differences between two directories ?what is the command for to display the last newly appending lines of a file during appendi

dos2unix only removes the control-M characters at the end of the line. You need to use sed to do the search and replace for '' to '/'.


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape