December 08, 2004, 12:54 PM — Tips and tricks for every-day Unix administration tasks and some clever ways to approach more challenging problems. Send your comments or questions to submissions@itworld.com.
Terminating unattended processes (03/27/2008)
Easy way to terminate processes left running after users log off a system. Read more.
More on bc (03/19/2008)
The bc utility is not just a command line tool. You can also write numerically intensive scripts in bc. The tool incorporates enough syntax to assign values to variables, write and call functions, collect responses from users and print annotated results. Read more.
Using bc for big calculations (03/12/2008)
For sysadmins who want to perform simple calculations on the command line, there's a considerably more useful tool than expr. Try bc. Like expr, the bc command allows you to do simple math. Here are some examples. Read more.
Burning bootable DVDs (03/05/2008)
One of the messages that you don't want to see when getting ready to upgrade a system to Solaris 10 is "can't open boot device". The problems this kind of error suggests, such as bad CD/DVD reader or improper device alias, can be troublesome. So, when I ran into this problem on a Friday afternoon, I was not amused. I had tried various boot commands, but got the same basic response each time... Read more.
Terminating options processing with -- (02/28/2008)
To understand how this works, think back to how the shell processes what it sees on the command line. If we type "ls -l a*", for example, the shell translates a* into a list of all files that begin with the letter "a" and then makes the appropriate system calls to provide a detailed listing of those files, complete with owners, sizes and most recently changed dates and times. Read more.
More on filenames (02/19/2008)
Another and simpler way to display file names that include unprintable characters is to use the -b option available with the ls command on some versions of Unix (e.g., Solaris). Read more.
Stripping file extensions with the basename command (02/14/2008)
I recently discovered a new trick for using basename to extract filenames from a full pathnames. Read more.
How-to rename an oddball file (02/06/2008)
Every now and then I come across a file that just doesn't display properly in a file listing. In fact, it can be a little tricky to determine the name of a file that contains odd characters. You might think a file's name is "myfile.txt" only to find out that it's really "myfile.txt " (note the extra blanks). Here's a way to name a file with an odd name. Read more.
Reassembling very large "split" filesync (01/30/2008)
One of the unwritten rules of computing says that, as various storage media grow in size, so do the files that are written to them. I recently found myself staring at two files, each roughly 4 GB in size, that needed to be combined into one before the file could be decompressed and its contents extracted. What I was expecting to work with was a large cpio archive ... Read more.
Experimenting with rsync (01/24/2008)













