Useful Unix Command for Everyday Administration

Printer management

The Printer (bdpcl) in Room 940 is the Lab printer, and it connects with Monviso.

It often makes trouble, so we should be a little careful when using it.

to check the printer statue, log in as root and type the following:

# lpq -P bdpcl (to check the tasks in printing queue on bdpcl Printer )
# lpstat (to check printer's statue)
# lprm -P bdpcl file-ID (to delete the printing task )

If the printer lignt is green and no warning message, just no response. the problem report is : "time-out connecting Printer Port.". then log in as root and restart the machine by this command:
# sync;sync;reboot

Space Management

There are many trash files generated everyday. We should check and clear them regularly.

Here is some directory which may hold some useless log file or message files.

Log in as root as type the following commands:

# cd /var/log/syslog
# ls -al
# cd /var/adm/message
# ls -al

We only need to keep the lastest two log and message files. Delete the older ones to save space.

Some other commands are useful:

# cd /etc/dfs
# more dfstab
# share....

System Management

The SUNs in our lab are a little bit old and run a little bit slow.

So it is very necessary to check the CPU occupancy and kill some dead programs.

# cd /var/spool
# du

If the machine runs abnormally, log in as root and type following commands to stop and restart it softly before shutting it down:
# /etc/init.d/nfs.server stop
# /etc/init.d/nfs.server start

To check the IP address of other machines in the LAN, type command:
# nslookup civitella.cs.uic.edu (check the ip address of civitella)

Set Environment variable / Path

After installing a software, we should add its path to environment file, then we can run it anywhere without locating the path of executable file manually.

The environment file name is different for different shells. It may be .tcshrc, .cshrc, .bashrc, .profile and so on. To add the environment variables, log in as the permitted user and type the following:
# ls -al (to check the environment file for current shell )
# pico .tcshrc (edit environment file to add the path, e.g .tcshrc)
# source .tcshrc (after changing the .tcshrc file, we need activate it by "source" command )
Home

Last Revised: 20 Nov 2003
Dan YU