RSS

Tech !!

UNIX :

*** Some Useful commands ***

TAR ONLY THE FILES. To tar only files (not

subdirectories) in the current directory use the

following command:
tar cvf tarfiles.tar ./`ls -l | grep -v ‘^d’ | awk

‘{print $9}’`

To tar files by name :

tar -cvf files.tar -l file1 file2

To Untar the .tar file :

tar -xvf tarfiles.tar

a)
To find all the pattern matched files from current and

sub directories :
find . -name “*.alog” -print

b)
To find a file using the pattern matched inside the file
find . -exec grep -l “ddd” {} \;

c)
To open a file using the pattern matched inside the file
vi `find . -name “open” -exec grep -l “ddd” {} \;`

Advertisements
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: