Unix commands and tools you just can't live without

Are you someone who never met a Unix command you didn't like? OK, maybe not. But are there commands you just can't imagine living without? Let's look at some that have made a big difference on my busiest days and those that people I've worked with over the years have said are their most important essentials.

By  

If I want to know, for example, all the possible values that the third field in such a file can assume, a command like this works wonders:

awk -F: '{print $3}' | sort | uniq -c

That command will show me each unique value along with a count of how many times each appears in the file. Plus it uses the colon character to know where "fields" start and stop. Commands like this are invaluable for getting quick answers from unwieldy data files.

sed and tr

I use sed as needed. Some of my Unix buddies use it as much as they do awk, but I use awk probably 50 times as often as I use sed. It's still among the basic tools that I need, just not as beloved as awk. I also use tr at least as often as I use sed. Both commands provide a way to modify text between pipes, just differently.

rsync

I've been deeply impressed by rsync ever since I was first introduced to the command. For super efficient synchronization of files and directories between servers, rsync is a godsend. And, yes, I can't imagine working without it.

scp

When I have to copy a file or set of files from one system to another, scp is my friend. I like that I can set it up for password-free operation for those automatic file transfers that I have to do from time to time.

perl

I'm still not a wizard when it comes to Perl scripting, but I'm good enough to do a lot of really cool file reformatting and
manipulation. Perl's use of regular expressions gives it a high ranking in my list of vital tools.

sar

I can't say that I use sar every day, but I definitely benefit from it every day. I get email from sar scripts that send me performance reports on some of my most critical servers. Every day. Long gone are the days that I only looked into system performance data when something way definitely wrong with my servers. These days, I look at performance data every day -- because it comes to me -- and I know what normal performance generally looks like on my systems.

for loops

Lastly, but not leastly, I depend heavily in for loops. I can't go a day without some form of for SOMETHING in `some command`. For loops save me lots of time every single day. And I can't imagine how I'd get all my work done or stay focused if I didn't have the option of looping through a complete set of values, regardless of their source. Whether systems, files or values of some other kind, for loops take the tedium out of having to check N things or run the same command for some large number of members of a particular data set.

And, of course, I take vi/vim and commands like date for granted, like breathing. And cron for getting work done while I'm asleep.

Photo Credit: 

flickr / L. Marie

Follow Sandra on Google+

Sandra Henry-Stocker has been administering Unix systems for more than 25 years. She describes herself as "USL" (Unix as a second language) but remembers enough English to write books and buy groceries. She currently works for TeleCommunication Systems -- a company that builds innovative technologies to make critical connections happen -- where no one else necessarily shares any of her opinions. Send comments and suggestions to bugfarm@gmail.com.

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Operating SystemsWhite Papers & Webcasts

See more White Papers | Webcasts

Answers - Powered by ITworld

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Ask a Question