x
Loading
 Loading
Hello, Guest | Login | Register

Wizard Boot Camp, Part 10: Utilities You Should Know

The time has come to leave Hogwarts, young wizard! We wrap up our ten-part series on becoming a command-line wizard with a look at more utilities you should know.

The time utility shows system resource usage. Compare the linear search to a binary search:

 $ time look -b gas gas gas's ... real 0m0.004s user 0m0.001s sys 0m0.003s 

Note that a binary search matches the search string exactly as a prefix. To use the -d (dictionary order) or -f (case-insensitive) search options with a binary search, the file must be sorted in that order!

You can also create files to search later with look.

 $ nice sort -t: -k1,1 invoices_raw > invoices ...later... $ look 172-102i: invoices 172-102i:2008-05-17:Smith, Alan:... 

nice reduces the scheduling priority of sort, reducing the impact that process has on other users and processes.

Other uses for the system word list

The system word list, often in the directory /usr/share/dict, can be searched with more than look. Need an eight-character word starting with n and a vowel, and ending in ly?

 $ cd /usr/share/dict $ grep -i '^n[aeiou]....ly$' words narrowly normally 

mail, sendmail, …

Want to send a quick email message? Years ago, everyone used mail to send and read plain-text messages. Now it’s half-forgotten but still useful for sending email. Also, if sendmail or another interface to the system mail transfer agent is available (and configured correctly), you can send email with almost-complete control over the message header and body.

Different versions of mail and sendmail support different options. Study and test to see what works on each system.

mail sends…

Please log in to view this content.

Not Yet a Member?

Register with LinuxMagazine.com and get free access to the entire archive, including:

  • Hands-on Content
  • White Papers
  • Community Features
  • And more.
Already a Member?
Log in!
Username

Password

Remember me

Forgotten your password?
Forgotten your username?
Read More
  1. Got Security? You're in Denial
  2. KDE 4.4: Does It Work Yet?
  3. Writing Custom Nagios Plugins with Python
  4. Power Up Linux GUI Apps
  5. Tweeting from the Command Line with Twyt
Follow Linux Magazine
Rackspace