*nix command line tip - man is your friend

  • February 20, 2007
  • Avatar for peter
    Peter
    Upfold

The command line is great. When you know how to use it properly, it can be the fastest way to achieve a task and it is endlessly extensible.

The problem is, commands and their syntax can be really tricky to remember. Sometimes you just can't remember what a particular switch does, or what switch you need to perform a particular task. My common one until recently was always forgetting which way round you use ln (I've taught myself that it's target, link name).

Thankfully, help is at hand, thanks to man. Short for manual, if you invoke the man command followed by the name of the command you're looking for help with, you'll get a rather geeky, but still often helpful manual page.

For example,

$ man ls

will show you all you need to know about ls.

Once you're viewing a man page, you can use page up and page down to scroll through and press q to quit out when you're done reading up.

If you're not at a machine with a decent CLI (read: a Windows box), a web search for man commandname will usually give you a web-based man page, which might help. It's sometimes best to use the ones on your system, though, if possible, as online versions might be talking about slightly differing versions of the commands on your system. For quick reference, though, they're great.

So next time you're sitting at the blinking cursor and you're stumped, try using man before giving up!

Avatar for peter Peter Upfold

Home » Articles »