CISC 105 - UNIX help
If you are unfamiliar with any of these commands, refer to your Just Enough UNIX text book.- Quota Management
quota -v
to view the current quota usagedu -h
to view the directory structure with sizes. You can then see which directories have the most stuff in them.
Usedu -ak | sort -n | grep M
to find the directories and files with more than 1 MB.If you have quota problems, do not log out. Delete the culprit large files.
Examples of what files to delete:
- Old
a.out
files. You can regenerate those files later by recompiling your program. core
files: these files are generated when an execution goes wrong.- mozilla and netscape cache files.
\rm -r .netscape/cache/*
or\rm -r .mozilla/cache/*
The full filenames should show up when you run the abovedu
command. - Generated output files
Ask me if you're unsure if a file can be deleted without consequence.
Managing files:
Some people are having problems with their quota because they have an infinite loop that writes to a file until the file becomes too large and exceeds their quota.
- When writing programs that write output to a file, first, check that the file output works correctly, i.e., .writes to the correct file.
- Then, change the output file to "stdout" and do your debugging with output printed to the terminal.
- Old
- Running programs in the background
cmd [args] &
To run a commandcmd [args]
in the background, follow the full command (including arguments) with an "&
"
For example:emacs &
. Emacs opens and the terminal is now available to run other commands.If you already started to run the program in the foreground, type 'Control-Z', which suspends the running program and gives you your prompt back. Then, type
bg
, which puts the suspended program in the background. Now, you can use emacs. - Manipulating files
pwd
present working directorycd [dir]
change directorySpecial names for directories:
-
.
the current directory ..
the parent directory~
home directory
ls
list files in the directorycp [srcfile] [destfile]
copy a file (srcfile) into another file/location (destfile)mv [srcfile] [destfile]
move a file (srcfile) into another file/location (destfile) -