Unix is case sensitive. This means you must be careful about using upper and lower case characters. Usually commands are given in lower case. You have to press the Enter key after typing each command. Some Useful Unix commands: ls //list contents of directories examples: ls -a //show all files in the current directory ls -l filename //show protections for a file ls -ld directoryname //show protections for a directory ls -s filename //show file size in kilobytes cd //change directory examples: cd public_html //move into the public_html subdirectory cd ~/. //return to user's home directory cd .. //move to the directory immediately above this one chmod //set file/directory permissions // Click here for more on chmod examples: chmod a+r filename.html //everyone can now read this file chmod a+x directoryname //everyone can now open (execute) this directory chmod o-r filename.html //others can not read this file (but you can) cp //copy files examples: cp file1 file2 //make a copy of file1 called file2 mv //rename a file or move it into a directory examples mv file1 file2 //renames file1 to file2 mv file directory //move a file into a subdirectory passwd //change your password pwd //print working directory (an easy way to //figure out what directory you are in.) rm //removes (deletes) files example: rm filename //delete the specified file rmdir //removes (deletes) directories example: rmdir dirname quota //helps you to check your disk usage //if you are over quota-delete that old mail! Note: You might want to create an "alias" so that you can quickly move to your public_html directory. To do this: pico .login (scroll to the last line of the file) (and add the line below:) alias 108 cd ~/./public_html/ This will take effect the next time you login. You can just type 108 to move to your public_html directory. Your .login file contains important set up information. Do NOT change this file if you are unsure about what you are doing. (And don't let your friends mess with it.) If this file is corrupted, you may not be able to do your assignments until you get it fixed.
Click here to return to the IT 108 page