The power of combining xargs, cut, tail, grep, seq, amazes me. What resource should I look at for a tutorial on the most useful linux commands for programmers?

I'm interested in just the ones programmers use most frequently, that will make my life easier.


10 Answers 10


The best thing you can do to learn this is to find problems and solve them. Go through this site, look at all the "How do I do X in awk/sed/grep/etc." and try them for yourself before looking at the answers. Look if you get stuck or to see how others did it once you find a way. If you find yourself doing something repetitive in the terminal, stop and think about how you might use one or more utilities to make it easier. If you can't find a way to do it, post here and we'll guide you.

  • Sidenote: seq, head, and tail (at least the most commonly used parts) are fairly trivial. I suggest you start out looking at grep to get comfortable with the searching half of regular expressions and sed (in parallel but lagging a bit behind grep) to get the replacement half (save the more advanced sed commands for later), then awk because it's quite a powerful tool. Then find, then xargs.
    – Kevin
    Commented Mar 2, 2012 at 16:45

The Unix Programming Environment by Kernighan and Pike is the classic on the topic. It's ancient but still in print, which should tell you something.

The Art of UNIX Programming by esr is much newer. I found it interesting and helpful, but with a bit more "advocacy" than I felt was necessary. (Euphemism for "frothing partisanship.") Be prepared to take his comparisons to other OSes with a grain of salt, as I recall finding outdated[1] material even when the book was new, and the *ix competitors have almost a decade of progress since that time.

[1] Mostly, I recall jabs at weaknesses in non-*ix OSes that had been eliminated before the book was published. The same sort of thing you find in amateur Windows vs Mac vs Linux arguments all over the net.


Follow the one-a-day plan. Start by listing everything in /sbin. Then take one command per day and type man command and find out what it does. The essential core commands are all in /sbin. After that, go to work on /bin and when that is finished, go to work on /usr/sbin and /usr/bin. You can shorten your list of commands by skipping any with more than 5 letters in the command name, and you will not miss many important things.

But the important thing is that you will learn something new every day, and probably before you are half way through, you will understand so much of the basics, that you can easily pick up half a dozen new commands per day.

But you have to use them, each and every one of them, even if it is only tinkering and doing exercises with them.

  • 2
    This is good idea. Learn commands one by one. Check what they do and master them.
    – Kamil
    Commented Mar 2, 2012 at 8:17
  • I can't agree about starting in /sbin, given the "for programmers" in the question title. On many systems, /sbin and /usr/sbin are in the default PATH only for root. I think you may be right to view them as "core" commands in the sense that they're key parts of the OS, but they aren't tools you use in programming so much as system administration. Commented Mar 2, 2012 at 17:27

One of the way is to start reading some blogs which specializes in Unix/Linux ..

This blog thegeekstuff where i write occasionally is one of a good place to start with ... Some important articles which you may be interested in are:

Where there is a series of tutorials about sed and awk Hope it is useful to you...

  • 3
    The 50 commands is the perfect answer to this question! Go through it, study examples of each command and if it's interesting, follow the link (usually provided) to further examples. That link's a keeper!
    – Bill K
    Commented Mar 2, 2012 at 19:04

For Bash I would check out tldp.org/LDP/abs/html/

  • 2
    The infamous "Advanced Bash Scripting" guide will teach you to write bugs, not scripts. Whilst the intentions in writing it were noble, the errata and misinformation is too high to recommend it. mywiki.wooledge.org/BashGuide is a far superior guide.
    – Chris Down
    Commented Mar 2, 2012 at 17:14
  • Thanks @Chris I thought the intro stuff was a good start.
    – Iman
    Commented Mar 2, 2012 at 18:57

Programmers have a unique opportunity to master Linux. Every chance you get, instead of writing a program to accomplish a task write a shell script to do it.

I actually have a standing personal challenge to write everything in Bash before I write a program - you'd be amazed and disturbed.

As far as a recommendation for a book, it might seem silly, but the Linux Pocket Guide has a place of honor on my bookshelf. It is compact and has loads of useful Linux programs. Perusing it is easy and its a great reference.


Unix Power Tools is very interesting to learn some tricks.


I will suggest you to get familiar with these: awk1line.txt and sed1line.txt.

info coreutils

gives you a big list of useful commands, grouped by context.

You can take this as a guide and learn one command a day, and of course as a repository to search in.


I would add Linux® Command Line and Shell Scripting Bible by Richard Blum. It'easy to understand, practical and full of many useful examples.

Not the answer you're looking for? Browse other questions tagged .