OIT Web Server Cheat Sheet for CMPSCI 120

logoutLog out of the server
Directories
cd dirChange current directory to dir
cd ..Change current directory to the parent of the current directory
cdChange current directory to your home directory (useful if you're lost)
mkdir dirMake a new directory called dir
rmdir dirRemove directory dir --- it must be empty!
pwdPrint working directory (show where you are)
Files
lsList all files in the current directory
ls dirList all files in directory dir
ls -lList all files in the current directory in long format (dates, permissions, etc.)
ls -l dir
ls -laList all files in the current directory, including hidden files, in long format
ls -la dir
ls -RList all files in the current directory, and all subdirectories
rm fileRemove (delete) file
cp file1 file2Copy file1 to file2
mv file1 file2Move (rename) file1 to file2
cp file dirCopy file into directory dir
mv file dirMove file into directory dir
Text Files
more fileView the text in file
less fileAnother way to view the text in file
nanoStart the nano text editor with a new, empty file
nano fileStart the nano text editor with file loaded (so you can edit it)
Permissions
chmod 755 fileLets the world view file, but only you can edit it.
chmod 700 fileLocks everyone besides you out of file; only you can read or edit it.

Quick notes on webpages