Below are some of the more common UNIX commands. NOTE: When you remove a UNIX file, it's really gone!! There is no wastebasket or recycling bin, and it does not maintain versions of files!! (The emacs editor, though, always keeps a backup copy of a file you're editing.)
man keyword | the most important command, get's help on keyword which is usually a command. Also try: |
man -k keyword | if you do not know the syntax of the command. Play around with these a bit. |
make | execute a Makefile to compile files |
cd directory | change to directory |
cd .. | go up one level in the directory tree |
cd / | go to root of directory tree |
ls | list all files in the current directory |
ls .* | check this out, those files are usually not listed |
ls -l | to see statistics about your files |
rm file | remove file |
rm * | remove all files (go easy on that one) |
cp file1 file2 | copy file1 to file2 (keeps file1) |
mv file1 file2 | renames file1 to file2. Can also me used to move files in the directory tree. |
mkdir directory | make a new subdirectory |
rmdir directory | remove subdirectory |
rm -r directory | removes files in and below subdirectory i.e. even files in its sub (sub..) directories |
more file | show file, one screen at a time |
head file | show first 10 lines of file |
tail file | show last 10 lines of file |
chmod 700 file | change access priviledges. 7 stands for read, write, execute priviledges. The first digit sets the rights for yourself, the next one for everyone in your group, the last one for everyone who has access to the computer on which the file is located. |
passwd | to change your password |
grep string * | searches all files in the current directory for occurrence of string |
lpr -Pprintque file | print file to printque. No space between P and printque. |
telnet machine | start remote session to machine |
ftp machine | if you want to transfer files between machines |
get filename | when in FTP, used to copy a file FROM a remote machine |
put filename | when in FTP, used to copy a file TO a remote machine |
logout | logout |