Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
3Activity
0 of .
Results for:
No results containing your search query
P. 1
unix tactic in commands

unix tactic in commands

Ratings:

4.6

(5)
|Views: 330 |Likes:
Published by arun

More info:

Published by: arun on Feb 25, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as SXW, PDF, TXT or read online from Scribd
See more
See less

05/13/2010

pdf

text

original

 
Command Description
apropos whatisShow commands pertinent to string.See also threadsafeman-t man | ps2pdf - > man.pdf make a pdf of a manual pagewhich command Show full path name of commandtime command See how long a command takestime catStart stopwatch. Ctrl-d to stop. Seealsoswnice infoRun a low priority command (The"info" reader in this case)renice 19 -p $$Make shell (script) low priority. Usefor non interactive tasks
dir navigation
cd - Go to previous directorycd Go to $HOME directory(cd dir && command)Go to dir, execute command andreturn to current dirpushd
.
Put current dir on stack so you can
popd
back to it
file searching
aliasl='ls -l --color=auto' quick dir listingls -lrtList files by date. See also newest and find_mm_yyyyls /usr/bin | pr -T9 -W$COLUMNSPrint in 9 columns to width of terminal
 
find -name '*.[ch]' | xargs grep -E 'expr'Search 'expr' in this dir and below.See also findrepofind -type f -print0 | xargs -r0 grep -F 'example'Search all regular files for 'example'in this dir and below find -maxdepth 1 -type f | xargs grep -F'example'Search all regular files for 'example'in this dir find -maxdepth 1 -type d | whilereaddir; doecho $dir; echo cmd2; doneProcess each item with multiplecommands (in while loop)find -type f ! -perm -444Find files not readable by all (usefulfor web site)find -type d ! -perm -111Find dirs not accessible by all (usefulfor web site)locate -r 'file[^/]*\.txt'Search cached index for names. Thisre is like glob *file*.txtlook referenceQuickly search (sorted) dictionary forprefixgrep--color reference /usr/share/dict/words Highlight occurances of regularexpression in dictionary
archives and compression
gpg -c file Encrypt filegpg file.gpg Decrypt filetar -c dir/ | bzip2 > dir.tar.bz2 Make compressed archive of dirbzip2 -dc dir.tar.bz2 | tar -xExtract archive (use gzip instead of bzip2 for tar.gz files) tar -c dir/ | gzip | gpg -c | ssh user@remote 'ddof=dir.tar.gz.gpg'Make encrypted archive of dir/ onremote machine find dir/ -name '*.txt' | tar -c --files-from=- |bzip2 > dir_txt.tar.bz2Make archive of subset of dir/ andbelow find dir/ -name '*.txt' | xargs cp -a --target-directory=dir_txt/ --parentsMake copy of subset of dir/ andbelow ( tar -c /dir/to/copy ) | ( cd /where/to/ && tar -x-p )Copy (with permissions) copy/ dir to /where/to/ dir ( cd /dir/to/copy && tar -c
.
) | ( cd /where/to/ && tar -x -p )Copy (with permissions) contents of copy/ dir to /where/to/ 
 
 ( tar -c /dir/to/copy ) | ssh -C user@remote 'cd /where/to/ && tar -x -p'Copy (with permissions) copy/ dir toremote:/where/to/ dir dd bs=1M if=/dev/sda | gzip | ssh user@remote'dd of=sda.gz'Backup harddisk to remote machine
rsync
(Use the --dry-run option for testing) rsync -P rsync://rsync.server.com/path/to/filefileOnly get diffs. Do multiple times fortroublesome downloadsrsync --bwlimit=1000 fromfile tofileLocally copy with rate limit. It's likenice for I/O rsync -az -e ssh --delete ~/public_html/ remote.com:'~/public_html'Mirror web site (using compressionand encryption) rsync -auz -e ssh remote:/dir/ 
.
&& rsync -auz-e ssh
.
remote:/dir/ Synchronize current directory withremote one
ssh
(Secure SHell)ssh $USER@$HOST commandRun command on $HOST as $USER(default command=shell)ssh -f -Y $USER@$HOSTNAME xeyesRun GUI command on$HOSTNAME as $USERscp -p -r $USER@$HOST: file dir/ Copy with permissions to $USER'shome directory on $HOSTssh -g -L 8080:localhost:80 root@$HOSTForward connections to$HOSTNAME:8080 out to$HOST:80ssh -R 1434:imap:143 root@$HOSTForward connections from$HOST:1434 in to imap:143
wget
(multi purpose download tool)(cd cmdline && wget -nd -pHEKk http://www.pixelbeat.org/cmdline.html)Store local browsable version of apage to the current dirwget -c http://www.example.com/large.fileContinue downloading a partiallydownloaded file wget -r -nd -np -l1 -A '*.jpg'http://www.example.com/dir/ Download a set of files to the currentdirectorywget ftp://remote/file[1-9].iso/ FTP supports globbing directly

Activity (3)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
ojay liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->