You are on page 1of 1

Unix, Linux, and Max OS X Commands

Common Filesystem Commands


cd

cp

change directory

Search Commands
find files and directories

~/.bashrc

bash run commands

cd foo

find .

~/.bash_profile

bash config file (linux)

cd ../..

find . type f name *.java

~/.profile

bash config file (mac)

search for text in files

~/.vimrc

vi/vim config file

copy files and directories

find

grep

cp /tmp/foo.txt .
cp f1 f2 f3 dir1
gzip

mkdir

more
ps
mv
rm

tar

wc

grep foo *
locate

compress a file
gzip bigfile.tar

ls

Configuration Files

mdfind

find files on the entire system

Sample Aliases

locate java

alias l=ls alF

(like locate; mac os x only)

alias h=history

list files and directories

alias cd..=cd ..

ls alF

Less-Common Commands

ls -aCF

cat

concatenate files

make a directory

chgrp

change group owner

Common Network Commands

mkdir dir1 dir2 dir3

chmod

change file mode

ftp

file transfer protocol

mkdir p a/b/c/d

chown

change file owner

ping

ping a remote system

scroll through a file

df

show free disk space

scp

secure copy

more bigfile.txt

diff

differences between files

ssh

secure shell

show running processes

du

directory usage (du s *)

ps auxwww

head

display the beginning of a file

Command Mashups

move files and directories

history

show history of commands

grep foo *txt | wc -l

mv f1 f2 f3 dir1

last

show last user login times

remove a file or directory

history | grep ssh

ln

link files and directories

ls al | more

rm oldfile

lsof

list of open files

ls al | grep Jul | grep v 2006

rm r olddir

man

man pages (help)

archive command

ls al | grep ^d

sed

streamline editor

ps auxwww | grep i java

tar czvf all.tgz *

sort

sort input

tar xzvf all.tgz

ps aux | wc l

strings

search for text in binary files

word count

who | wc -l

tail

display the end of a file

wc l file1 file2

who

who is on the system

alias html=cd /usr/local/html

devdaily.com/unix

You might also like