UNIX

Unix/Linux Commands

command descritpion
command > file sends what would be printed to the terminal instead to a file. Also >> < <<.
cd dirname change directory .. is up one directory and . is the current directory
chmod filename changes the permissions of a file u g o +/- r w x
chown user filename changes the owner of a file to user
cp filename1 filename2 copies filename1 to filename2
du dirname gives the amount of memory (disk usage) of the directory (or all files if no dirname is given)
emacs -nw filename opens filename with emacs in the in the terminal (emacs must be installed)
grep string filenames grep will search for the given string in a file
head -N filename prints the first N lines of a file in a the terminal
less filename displays the text of a file in a the terminal
ls list the contents of a directory -a will list [dot]files -l will give more information
man command prints the manual page of the command in the terminal
mkdir dirname makes a directory names dirname
more filename displays the text of a file in a the terminal
mv filename1 dirname moves a file to a different directory or renames it dirname if not a directory
nohup command nohup before a command insures that the process won't be killed if you kill the window
pwd the present working directory is printed in the terminal
rm filename removes a filename permanently
scp filename hostname:filename copies a file securely to or from a remote machine
ssh user@hostname logs user into a remote machine
ssh-keygen -t rsa generates a private/public key pair using rsa encryption
ssh-copy-id -i hostname copies the key to a remote host (not installed on OSX use homebrew)
tail -N filename prints the last N lines of a file to the terminal
top prints the top jobs running on the cpu and information about them
vi filename opens filename in the vi text editor in the terminal
wc filename word count of filename gives characters words and lines

Comments are closed.