Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
    
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
add comment

2 Answers

up vote 9 down vote accepted

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.

share|improve this answer
    
That's great, thanks! Got a feeling I'll be back here a lot over the next few days! –  Martin Hunt Apr 10 '12 at 18:40
    
man -k whatever is also worth trying. That does a keyword search in the man pages. –  Faheem Mitha Apr 11 '12 at 15:58
add comment

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).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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