MIT

Web Guide is no longer being maintained and the information on this page may be out of date. For assistance with managing course materials, please visit MIT's Stellar course management system.

Academic Web Page Creation Guide


Publishing Your Pages > Using an Athena Course Locker > Managing Files and Directories on Athena

Managing Files and Directories on Athena

Information in This Section

General Hints

Contents of Your Web Site

The basic command for listing the contents of an Athena locker is ls. To see a directory listing, specify the path, as follows, or omit the path for the current directory:
    athena% ls path
The following examples assume that you started the session by typing:
    athena% attach 29.123
    athena% cd /mit/29.123/www
This designates your current directory as:
    athena% pwd
    /afs/athena.mit.edu/course/29/29.123/www

Creating Files and Directories

There are numerous ways to create a file directly on Athena (i.e., rather than transferring over files created on your own machine). For HTML, you would generally use a text editor such as vi or emacs (Athena's primary supported editor). The primary supported word processing package on Athena is FrameMaker (which can be used to save to various Web-friendly formats: text-only, HTML, or PDF), and there are several HTML editors including HotMetal Pro. For a comprehensive list of applications available on Athena, see the What Runs Where page.

To create a new directory in the current directory, the command is mkdir:

    athena% mkdir directory-name
For example:
    athena% mkdir images
You can also use mkdir to create a subdirectory in a different place, by specifying the path as well as the new directory's name:
    athena% mkdir path/new-directory-name

Moving or Renaming Files and Directories

The same command, mv, is used when you want to move a file or directory to another directory, or rename a file in the same directory. To move a file or directory, the format is:
    athena% mv file-or-directory target-path
For example, to move a file named test.html from the current directory into the directory /mit/29.123/www/exams:
    athena% mv test.html /mit/29.123/www/exams
To rename a file or directory, the format is:
    athena% mv old-name new-name
For example, to change a file's name from test.html to index.html:
    athena% mv test.html index.html
When moving a directory, note that:

Deleting Files and Directories

Athena has two commands for getting rid of unwanted files: delete and rm.

Unless you need to remove large files immediately because you are over disk quota, it is a good idea to use delete instead of rm to protect yourself against accidentally removing files.

For example, to delete a file named oldindex.html in the current directory:

    athena% delete oldindex.html
If you realize this was a mistake, to undelete it:
    athena% undelete oldindex.html
If you are sure you want to permanently remove the file:
    athena% rm oldindex.html
To remove a directory, you can also use the command delete as long as the directory doesn't contain any files. If it does contain files, and you want to delete the directory and all of its contents, use delete -r, for example:
    athena% delete -r exams
To remove a directory permanently use the command rmdir (the directory must be empty of files):
    athena% rmdir exams

Recovering Files from the OldFiles Directory

At the top level, each course locker contains a directory named OldFiles. OldFiles is a snapshot of the contents of the locker, usually from the day before, which can be used to recover a file if it is mistakenly removed, or to undo recent modifications to a file. This works only if you removed or modified the file within a certain time frame, so that the previous version still exists in the latest snapshot. For example, if you deleted a file three days ago and your OldFiles snapshot was made by the system yesterday, the file will not be there. Similarly, if you created a file this morning and accidentally deleted it this afternoon, you would not find it in OldFiles, as the snapshot for today has not yet been taken.

The structure under OldFiles is the same as in the locker itself. For example, the snapshot of the 29.123 Web site would be in the directory:

    /mit/29.123/OldFiles/www
and the index page would be in
    /mit/29.123/OldFiles/www/index.html
You can check the age of a file in OldFiles using ls -l:
    athena% ls -l /mit/29.123/OldFiles/www/test.html
    -rw-------   1 jqprof   mit  13744 May 31 16:13 /mit/29.123/OldFiles/www/test.html

OldFiles is set to be read-only, so you must copy files to another part of the course locker in order to work on them. If yesterday you had a file named test.html and accidentally deleted it today, you could get back yesterday's version as follows:

    athena% cp /mit/29.123/OldFiles/www/test.html /mit/29.123/www
Note that this command would overwrite /mit/29.123/www/test.html if it already existed. To copy the file over with a new name for comparison or testing, specify a different name, for example:
    athena% cp /mit/29.123/OldFiles/www/test.html /mit/29.123/www/test-old.html

Quota (Disk Space)

The standard disk space allocation, known as quota, for new course lockers is 200MB (as of fall 2002); older lockers retain their original quotas unless instructors request an increase from the Faculty Liaisons. To view your quota and total disk space usage, use the command fs lq (file server, list quota), as follows:
     athena% fs lq path
For example:
     athena% fs lq /mit/29.123
     Volume Name            Quota    Used    % Used   Partition 
     course.29.123          20000   11627       87%         73%  
The column labels identify the following: You may also examine your disk space use in more detail.

Reusing Course Lockers

Course lockers are re-used from semester to semester. Locker owners/maintainers are advised that any files they leave behind in a course locker at the end of the semester may be deleted or re-used by course staff who later inherit the locker. At the end of the semester you are responsible for saving any files that you wish to keep, and for deleting anything which you do not wish to share with subsequent course staff.

When an existing course locker is reused in later terms, the FLs try to notify the people already on the ACLs as a courtesy, but it is up to new course staff to follow up with previous course staff regarding the disposition of any existing files. We are happy to assist you with archiving existing files in an inherited locker, and clearing out or archiving your own files at the end of the term.