Unix Cheat Sheet

loianeg 2,568 views 1 slides Mar 17, 2010
Slide 1
Slide 1 of 1
Slide 1
1

About This Presentation

Unix, Linux, Mac OS Cheat Sheet commands


Slide Content

Common Filesystem Commands cdchange directory
cd foo
cd ../..
cpcopy files and directories
cp /tmp/foo.txt .
cp f1 f2 f3 dir1
gzipcompress a file
gzip bigfile.tar
lslist files and directories
ls –alF
ls -aCF
mkdirmake a directory
mkdir dir1 dir2 dir3
mkdir –p a/b/c/d
morescroll through a file
more bigfile.txt
psshow running processes
ps auxwww
mvmove files and directories
mv f1 f2 f3 dir1
rmremove a file or directory
rm oldfile
rm –r olddir
tararchive command
tar czvf all.tgz *
tar xzvf all.tgz
wcword count
wc –l file1 file2
devdaily.com/unix devdaily.com/unix
Unix, Linux, and Max OS X Commands Unix, Linux, and Max OS X Commands
Common Network Commands
Configuration Files ftpfile transfer protocol
pingping a remote system
scpsecure copy
sshsecure shell
Less-Common Commands catconcatenate files
chgrpchange group owner
chmodchange file mode
chownchange file owner
dfshow free disk space
diffdifferences between files
dudirectory usage (du –s *)
headdisplay the beginning of a file
historyshow history of commands
lastshow last user login times
lnlink files and directories
lsoflist of open files
manman pages (help)
sedstreamline editor
sortsort input
stringssearch for text in binary files
taildisplay the end of a file
whowho is on the system
~/.bashrcbash run commands
~/.bash_profilebash config file (linux)
~/.profilebash config file (mac)
~/.vimrcvi/vim config fileSearch Commands findfind files and directories
find .
find . –type f –name “*.java”
grepsearch for text in files
grep ‘foo’ *
locatefind files on the entire system
locate java
mdfind(like locate; mac os x only)
Command Mashups
grep foo *txt | wc -l
history | grep ssh
ls –al | more
ls –al | grep Jul | grep –v 2006
ls –al | grep ’^d’
ps auxwww | grep –i java
ps aux | wc –l
who | wc -lSample Aliases alias l=“ls –alF”
alias h=history
alias cd..=“cd ..”
alias html=“cd /usr/local/html”