<<

Unix, , and Max OS X Commands

Common Filesystem Commands Search Commands Configuration Files change find files and directories ~/.bashrc bash run commands cd foo find . ~/.bash_profile bash config (linux) cd ../.. find . – f –name “*.java” ~/.profile bash config file (mac) copy files and directories search for text in files ~/.vimrc / config file cp /tmp/foo.txt . grep ‘foo’ * cp f1 f2 f3 dir1 find files on the entire system Sample Aliases gzip compress a file locate java l=“ –alF” gzip bigfile.tar mdfind (like locate; mac os x only) alias h= ls list files and directories alias cd..=“cd ..” ls –alF -Common Commands alias html=“cd /usr/local/html” ls -aCF concatenate files a directory change group owner Common Network Commands mkdir dir1 dir2 dir3 change file mode ftp file transfer protocol mkdir –p a/b//d change file owner ping ping a remote system scroll through a file show free disk space scp secure copy more bigfile.txt differences between files ssh secure show running processes directory usage ( du –s * ) ps auxwww display the beginning of a file Command Mashups files and directories history show history of commands grep foo *txt | -l mv f1 f2 f3 dir1 last show last user login times history | grep ssh remove a file or directory files and directories ls –al | more rm oldfile list of open files ls –al | grep Jul | grep – 2006 rm –r olddir man man pages () ls –al | grep ’^d’ tar archive command streamline editor ps auxwww | grep –i java tar czvf all.tgz * sort input ps aux | wc –l tar xzvf all.tgz search for text in binary files | wc -l wc word count display the end of a file wc –l file1 file2 who who is on the system devdaily.com/unix