This document is a supplement to "Out of (CIS Unix) Disk Space?" It is for users who would like to remedy their disk space dilemmas by establishing a login session to one of the CIS Unix login servers and giving shell commands.
Information on how to establish such a session is here.
Once you've logged in, if you see the "CIS Unix Menu" displayed, get a normal shell prompt by making the appopriate choice from the menu if necessary.
A one-screen tutorial on some shell commands may be obtained via the
helpcommand:% helpThe
showquotacommand will tell you how much disk space you're currently using and your quota:% showquota Used 249.3M; Quota 256.0MUse it often to check your cleanup progress.
A login session gives you full access to all the files in your account. Your shell commands are executed immediately. Be careful.
Directory Navigation
Your CIS Unix home directory is hierarchical; it can contain
subdirectories, which themselves can contain subdirectories, etc.
You can navigate up or down in your directory tree using the
cd command.
The command
% cd dir
… will make dir your current directory. (You'll
want to specify an actual directory name instead of dir,
of course.)
To move "up" one level in the directory tree:
% cd ..
No matter where you are, a bare cd command
will return you to your home directory:
… and the% cd
pwd command can be used to tell
you the path to your current directory:
% pwd
Finding out where your disk space is being used
This command:
% du | sort -n… will list all subdirectories in your current directory, sorted into order by how much total disk space they consume. The command may produce a lot of output, but the important (big) stuff will be at the end. The last line will be the grand total for your current directory. (Note: that's a vertical bar character between the du and sort commands, not a slash.)
This command:
% ls -arlSh… will list the contents of your current directory in ascending order by size. Again, there may be a lot of output, but the big stuff you're probably interested in most will be at the end. Directories are indicated with a
das the first character on the line.The
findcommand is useful for scanning through an entire directory tree for files that match criteria you specify. For example, here's a command that will list all files in the current directory and all subdirectories over 1 Megabyte (2048 blocks) in size:% find . -size +2048 -ls
Deleting Stuff
Here's where you'll want to be careful. The rm command
is used to remove files and directories.
Before you give the command, ask yourself
if that's what you really want to do. In fact, ask yourself
at least a couple times. In normal operation, the
rm command will not ask if you "really mean to do this."
It will simply execute your instructions.
-
To remove a file:
% rm filenameSubstitute the actual file name for
filename. To remove a directory and all its contents, use
rm -rf:% rm -rf dirnameSubstitute the actual directory name for
dirname.Note: do not delete your
mailor.mailspooldirectories.
Alpine
You can, if you wish, delete mail messages and entire mail folders with the Alpine mail program. To start it up:
Alpine is very self-explanatory with plenty of onscreen help. A tutorial is here. A couple of tips useful for cleanup:% alpine
-
At Alpine's main menu, you can type
Lto see your mail folders. You can delete an entire mail folder by highlighting its name with the cursor keys and pressingD. (You'll be asked if you're sure you want to do that.) -
If you don't want to delete a whole folder, you may want to delete messages in it. You can display the contents of a mail folder by highlighting its name in the folder list, then pressing the Enter key. Once you see the "message index", you may want to sort the messages by size: use the
$(dollar) key followed byZ. -
Highlight a message you want to delete with the up/down cursor keys, and press the
Dkey to mark it for deletion. Repeat as desired. Once you've marked all the messages you want to delete, hit theXkey to "expunge" it from the folder. (You won't save any space in your directory unless and until you expunge.)
Page Maintenance: Paul A. Sand <pas@unh.edu> Last modified: 2012-05-07 9:06 AM EDT
[W3C Validator]

