·¬ÇÑÉçÇø

Linux hints and tips

We maintain a number of Linux systems for administrative and teaching purposes. It also maintains a number of Linux systems for various research groups within the department.

Users should be able to access appropriate Linux systems within the department with their NetLink credentials.

Most of the commands listed below are run via a terminal window when logged in locally to a Linux system, or when logged in remotely via ssh. There are a number of software packages available to access the systems remotely.

It is highly recommended that you spend a few minutes to understand some of the concepts and tips below. For example understanding the difference between "home directory space" and "project space" is important in terms of what is and is not being backed up and how much disk space is available. In the following sections you will find both effective time savers, and items that may prove vital to your work.

For more information please contact the departments Programmer Analysts.

Computer and network security is a very important item to keep in mind. The is a good resource for university security information.

Here are some additional items, and to that can't be said enough:

  • Never provide your NetLink password to anyone. We will never ask for it;
  • Don't open attachments that you do not expect to receive, even if they appear to be from someone that you know;
  • Secure your files, make sure the files in your home directory are not world readable (chmod -R o-r ~). The caveat to this is that some items may need to be readable to work as expected such as files in your personal webspace.
  • Backup important information.

There is no sudo access setup to any of the department maintained Linux systems, all sudo attempts will be logged.

When you login to a department maintained Linux system, you will be able to read and write to files in your engineering based home directory. This directory is common across all systems, so you should see the same files on your desktop regardless of where you login.

While consumer grade disk space is relatively inexpensive, enterprise disk requirements do have significant costs. As such, all home directories have a disk quota associated with them. When you reach your disk quota, things stop working as expected, so below are some commands to find out where you are at with respect to your disk quota, and where you are using the space.

Home directories are regularly backed up, with smaller files being backed up more frequently than larger files. For more details, please contact the department's programmer analysts.

Checking your quota

quota -v

This command displays where you are at with respect to your current quota limits.

Determining where you are using your disk space

du -k

This command shows how much space is used within the current directory (and all its subdirectories) in kilobytes.

du -k | sort -n

The sort addition sorts the list in ascending numerical order which can be a convenient way to find which subdirectories are large.

ls -l | sort +4n

This ls/sort command will show a listing of files in the current directory and sort them in ascending order based upon size.

ls -lrS

This ls command will also show a listing of files in the current directory and sort them in ascending order based upon size.

find . -atime +100

This command will find all the files within the current directory and all its subdirectories that have not been accessed (looked at) in the last 100 days (100 was arbitrarily chosen).

find . -atime +100 -exec ls -l {} \; | cut -c24- | sort -n

As above, but produces a list that is sorted based upon the file size.

Compressing files and directories

gzip filename

This command compresses the file named filename and renames it to filename.gz to indicate that it is compressed. To decompress the file in the future use gunzip in the same fashion.

tar cvf outputfile.tar filename1 filename2 ...

This command combines the files filename1 filename2 ... into one file named outputfile.tar. This file does not delete/remove the files that are combined. To extract the files later, simply use "tar xvf outputfile.tar". Often one will compress the outputfile.tar with the previously mentioned gzip command.

tar cvf - filename1 filename2 ... | gzip > outputfile.tar.gz

This command combines both the previous command into a single line.

Deleting files and directories

rm filename

This command deletes the file named filename.

rmdir dirname

This command removes the empty directory (ie no files or directories within it) named dirname.

rm -rf dirname

This command deletes the directory named dirname and all of the files and directories within it. Caution this command can be very dangerous, so double check that you want to delete the directory and what you have typed before pressing <Enter>.

Words of wisdom

If you are deleting files via a graphical interface (filemanager), be sure to empty the trash as it tends not to be emptied automatically.

Before deleting any file, ensure that you are deleting stuff that is safe to delete. If you are deleting files that you have combined with a tar command, you may consider extracting the file to a different location to verify that it was combined properly before deleting the original.

A number of research groups have project directories available to their group members. These directories are generally available at:

/project/projectdir/username

where the projectdir is group specific project directory name, and the username is the NetLink id of a respective user in the group. Project directories (projectdir) are automatically mounted on request, so if you go to /project and see nothing in the directory, there is nothing to be concerned about as you need to access an appropriate directory before it will appear. Simply 'cd' or 'ls' the next level and then you should be able to work normally.

Project directories have a key difference from home directories in that generally there are no quota's setup on the directories, so you are limited just by how much disk space is available on the disk (but don't use all of it for extended periods as the other group members may not appreciate the lack of space).

As there is a lot of disk space available, the project directories are not normally backed up. So if the drive fails that's hosting the directory, then the data is lost. For this reason, it is recommended that items which are not reproducable (ie, your thesis, papers that you are writing, source code for projects, etc) be stored in your home directory while reproducible items (ie, papers downloaded from the internet, simulation results, etc) be stored in project space. If you have simulation results that you'd like backed up and have access to more than one project directory, then you could copy the results to another project directory.

To find out what project directories are available to you either check with other members of your research group (they'll have access to the same proejct directories) or contact the department's programmer analysts.

Backup frequency

Below are the guidelines for when files are backed up in your home directory:

  • Term - on the first day of the term (ie January 1, May 1, and September 1), all files that have changed are backed up, and a consistency check is performed to ensure the file on the backup server matches that of the home directory.
  • Monthly - on the first day of the month, all files less than 2GB in size that have changed through-out the month are backed up;
  • Weekly - early Sunday morning, all files less than 1GB in size that have changed through-out the week are backed up;
  • Daily - occuring overnight, all files less than 127MB in size that have changed through-out the day are backed up;

Only a single backup process occurs throught-out the day. The first timeframe to match in the above list is the process that will occur as it includes the processes below it.

Backup retention

Backups are retains for the next significant time frame. So:

  • Daily backups are retained for one week
  • Weekly backups are retained for one month
  • Monthly backups are retained for one term
  • Term backups are retained for one year

Other backup information

Faculty, staff, researchers and graduate students, whos home directories reside on ECE servers, should be able to recover files from our backups by accessing the files at /project/backup/username. This can also be used to inspect your backups and find out what is currently in your backups. Please note that you will have access to only your backups, and that the backup space is read-only space so you will not be able to modify the contents.

Along with the backups, we copy the term backups to tape, in order to recover older items. The tapes are held onto as long as we can read the media. Please contact the ECE Programmer Analysts for more details regarding this.

The latest backup snapshots are also backed up to the University's Tivoli Storage Manager (TSM) service for off-site purposes.

When accessing the systems remotely, you need to know various commands that are available to run the programs and possibly have them display on your desktop.

These commands are generally found in your command path, so you can 'ls' various directories such as /bin, /usr/bin, /usr/local/bin, /opt/bin, etc to see all the commands available.

Below is a list of some of the more commonly looked for commands:

Package Description Command(s)
Web development studio bluefish
Web browser firefox
Text editor gedit
Image manipulation program gimp
Waveform analyzer gtkwave
Electronic schematic diagrams and printed circuit board artwork kicad
Office suite oowriter
oocalc
ooimpress
oodraw
WYSIWYM (What You See Is What You Mean) document processor lyx
Symbolic mathematics package maple
xmaple
High level numerical processing language matlab
mcc
mex
High-level interpreted language, primarily intended for numerical computations octave
Quite universal circuit simulator qucs
TeX document production system bibtex
dvips
epstopdf
latex
pdflatex
xdvi
Digital Circuit Editor and Simulator tkgate
Open source IC layout editor toped
Text editor vim
Vector based graphics xfig