The central servers (e.g., copland.udel.edu, strauss.udel.edu, mahler.udel.edu, etc.) run on the UNIX operating system. On these servers, you store information in computer files. You can create directories and subdirectories to organize these files.
The commands listed below will help you create, manage, and organize your files.
Note: Follow these guidelines when using any UNIX commmand:
To display a list of files in the directory in which you are working, type one of the following commands:
Command | Action |
---|---|
ls | Displays a list of files and subdirectories in the directory in which you are working. |
ls -a | Displays a more complete list containing those files that begin with a "." (dot). For example, the ".login" file. |
ls -F | Displays files and directories so that directories are marked with a trailing slash ("/") and executable files are marked with a trailing asterisk ("*"). |
ls -la | Displays all files and directories in long format, giving details about each file and directory. |
ls -t | Displays files and directories by the time they were modified rather than alphabetically. |
ls -r | Displays a list of files and subdirectories in your current directory as well as on all of its subdirectories. |
To see the sizes of files in the directory in which you are currently working, at the UNIX prompt, type:
ls -l | more
You will only be able to see one screen of information at a time. Press the SPACEBAR to advance to the next screen. The information on your computer screen should look similar to the following:
On the far right is the file name (e.g., file1), just before that is the date (e.g., "Feb 11 16:29") which displays the date and time rather than the date and year because it is less than 6 months old, and just before that is the size of the file in characters or bytes (e.g., "109").
In the far left column, if a row has a d at the beginning, it is a directory. To see the size of the files in that directory, you have to change into that directory. (See the section on managing directories for instructions about how to change to a different directory.)
To see all files in the directory in which you are currently working, at the UNIX prompt, type:
ls -la | more
You will only be able to see one screen of information at a time. Press the SPACEBAR to advance to the next screen. The information on your computer screen should look similar to the following:
To delete a file from your account, at the UNIX prompt, type:
rm filename
replacing filename with the name of the file you want to remove.
To be prompted for confirmation before you remove a file, at the UNIX prompt, type:
rm -i filename
replacing filename with the name of the file you want to remove.
You may have a file named core in your home directory. This file is the result of an aborted process and can be deleted.
To find out if you have such a file, at the UNIX prompt, type:
ls core
If you see the word "core" repeated, you have the file.
To delete the file, at the UNIX prompt, type:
rm core
To display the contents of a file, one screen at a time, at the UNIX prompt, type:
more filename
replacing filename with the name of the file. To see the next screen of text, press the SPACEBAR. To quit, press the Q key. To display a list of commands, press the H key.
To display the contents of a file without pausing between screens, at the UNIX prompt, type:
cat filename
replacing filename with the name of the file.
To copy the contents of one file into another file, at the UNIX prompt, type:
cp oldfilename newfilename
replacing oldfilename with the name of the original file and newfilename with the name of the new file. You will now have two copies of the same file.
To rename (move) a file, at the UNIX prompt, type:
mv oldfilename newfilename
replacing oldfilename with the name of the original file and newfilename with the name of the new file. You will now have one copy of the original file—listed under the new name.
To organize your files on the central UNIX server, you can create directories and subdirectories.
To create (make) a directory, at the UNIX prompt, type:
mkdir newdirectoryname
replacing newdirectoryname with the name of the new directory.
To change to a different directory, at the UNIX prompt, type:
cd directoryname
replacing directoryname with the name of the directory to which you want to change.
To return to your home directory, at the UNIX prompt, type:
cd
To identify the name of the directory in which you are currently working, at the UNIX prompt, type:
pwd
To return to your home directory, at the UNIX prompt, type:
cd
To remove (delete) a directory, at the UNIX prompt, type:
rmdir directoryname
replacing directoryname with the name of the directory you want to remove. Note: Normally, all files must be removed from the directory before the directory can be deleted.
To remove a directory without removing all of the files first, at the UNIX prompt, type:
rm -ir directoryname
replacing directoryname with the name of the directory you want to remove. You will see a system message asking whether you want to remove each file in the directory. This system message prevents you from deleting files unintentionally.