Unix Support and Troubleshooting
-
Space problems
(over quota)
-
Do "rm-junk" in
your home directory.
- This deletes all the "core" files and compiler cache files.
-
Clean up C++
executables and compiler junk
- The makefiles generated by makemake
include commands called "make clean" and "make realclean"
- "make clean" will delete all object files (.o files) and
compiler junk. "make realclean" will also delete executables
created by makemake. Executables are large (several MB) so it is
good to delete them. But if you want to run the programs again,
you will have to rebuild them. Deleting executables is usually
safe because you will have the source code if you want to create them
again - if this is not true for any reason, don't execute the find
command given below!
- The command below will search for all files named "Makefile"
and execute "make realclean" on them.
- Do "find . -name Makefile -exec make -f {} realclean \;" from
your home directory. Copy-paste this command, because it has to
be exactly like this. You may change the arguments "realclean" to
"clean" or "Makefile" to "makefile" if those are what you need.
To understand the command better, use "man fnd"
- The command will give you lots of error messages - because
some of the files don't exist, because some of your Makefiles will not
be from makemake etc. You can generally ignore them.
- Of course this will delete all the build files for any
projects you are currently working on. Just recompile.
-
Delete
"solution" executables that you are given for labs etc.
- These executables also consume a lot of space, and are not
deleted by "make realclean". You must delete them by hand.
Make a practice of cleaning up as soon as you find a lab or project
submission.
-
"tar" and
"compress" files, and possibly move them to your machine at home.
- Use the command "tar" to create a single "zip"-type archive
file of all your stuff. "man tar" will tell you how to use tar.
- A typical usage is "tar cvf myfiles.tar file1 file2 ... dir1 dir2...".
This will create a single archive containing the specified
files, and the specified directories (recursively i.e. including all
directory contents). Make sure you clean up inside directories
before you archive them.
- Tar does NOT compress files, so the tar file will be bigger
than the original files. You need to compress them by hand.
(If your account is already over quota, and you cannot create the tar
file at all, you can create it in /tmp e.g. "tar cvf /tmp/myfiles.tar dir1 dir2...")
- There are two compression utilities on UNIX: compress and
gzip. Both are good. If you are moving files to Windows,
gzip may be slightly better, since pretty much all Windows programs can
read GZIP files. Th command is simply "compress filename" or "gzip filename". The commands
operate in place i.e. they replace the original with the compressed
file.
- The tarred and compressed file may be easily moved to your
home machine using ftp (has to be some secure ftp program, such as the
"psftp" that comes with putty). Remember to ftp in binary
mode. A simple alternative is to move the binary file to your
"public_html" directory and use your browser to download.
- For those who do not know, if you create a directory called
"public_html" in your Unix account, it becomes your dept website
(index.html in that directory is your homepage). Make sure the
directory and all subdirectories have global read-and-execute
permissions and that all files have global read permissions.
- The corresponding unpacking commands are "uncompress" and
"gunzip".
- To extract files from a tar file, use "tar xvf filename". Remember that will
write the extracted files to the current directory.
-
Keep copies at
home of your completed projects
- It is a very good idea to keep copies at home of all the
projects you do in courses here - they form a "portfolio" in case you
need to show work samples to a future employer.