I'm currently setting up my first web server without a control panel and so far things are going pretty good!

I was just wondering if anyone could direct me to somewhere that explains all of the available command options and what they do?

Since I'm mostly following guides to set up specific things on the server, sometimes I run in to a command like

sudo mkdir -p /var/www/ve-server{1,2}.com/{html,logs}

Which I understand apart from how the -p option is modifying the command.

  • In the case of mkdir, -p means "If the parent directories don't exist yet, create them too"
    – Shadur
    Apr 11 '12 at 5:43

I think you're looking for man command.

Try doing man mkdir and look for what the -p switch does. You can use vim style searching here.

Use man man for more info on how to use man command.

  • That's great, thanks! Got a feeling I'll be back here a lot over the next few days! Apr 10 '12 at 18:40
  • 1
    man -k whatever is also worth trying. That does a keyword search in the man pages. Apr 11 '12 at 15:58

Many commands print a brief summary of the possible options when you invoke them with --help. This won't explain in detail what the options do, but it's a good way to find the name of an option you've forgotten, or to find what options are available if you already have some basic familiarity with a command. Not all commands support --help, but I've yet to encounter a command that did any damage when run with --help, so go ahead and try. A few commands respond to -help but not to --help.

The traditional documentation utility on unix is man. For many programs, and in particular most command line utilities, run e.g. man mkdir to see a description of the command and its options.

A few commands are built into the shell. These have no man page; they are documented in the shell man page instead (man bash or man bash-builtins, if your shell is bash; man zshbuiltins if your shell is zsh). Run type COMMAND_NAME (e.g. type mkdir) to see whether a command is a builtin or an external program.

Beyond that, there may be more specific documentation. For example, the complete reference for mkdir on Linux is the coreutils manual (under mkdir).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.