Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been doing some research on how to add a user to the system so as to have a new ftp user and one of the examples I ran across was this:

useradd -m -G users,ftp,wheel joe -s /bin/bash
passwd joe
chown -R joe /var/www/

I'm new to Linux and I don't understand what is being done here after each of the initial commands (useradd, chown). Can someone please enlighten me or provide a resource where I can learn - I'm having trouble finding anything useful when I search "linux minus sign commands".

Sidenote: In my search for answers, I typed tried to find a manual on these minus commands by trying man -d. Did I break something?

share|improve this question

closed as off-topic by mdpc, masegaloeh, Ward, Sven Dec 6 '14 at 9:50

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – Sven
  • "Requests for product, service, or learning material recommendations are off-topic because they attract low quality, opinionated and spam answers, and the answers become obsolete quickly. Instead, describe the business problem you are working on, the research you have done, and the steps taken so far to solve it." – mdpc, masegaloeh, Ward
If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 1 down vote accepted

For starters, from your command line type man COMMAND so man useradd etc.

That will display the manual for each command.

There are ways more simple than your example above such as:

useradd -m tommy creates the user tommy and a group tommy as well.


usermod -a G users,wheel,ftp tommy adds the user tommy to the groups "users, wheel, and ftp"

passwd tommy allows you to change the password for the user account tommy

chown -R tommy /var/www recursively changes ownership of the /var/www directory to make tommy the owner. Though becareful because normally the apache user should have ownership of the /var/www directory.

share|improve this answer
Sorry if this is a stupid question, but what do you mean when you say recursively changes ownership? My research would lead me to believe that it means it changes ownership for everything within that directory whereas a non-recursive change would only apply to /var/www but not child files/directories. Does that sound right? – Nick Mar 31 '11 at 4:46
Yes that would be correct. – Eli Mar 31 '11 at 4:52

I think Eli's said nearly all that needs to be said, but since your question indicates some confusion, I thought I'd be explicit about one thing:

The arguments that follow each initial command, each appearing after a - sign, are known as switches or flags, and they modify the behaviour of the initial command. There is little that is generally-valid about flags, though -v for "be verbose in your actions" is fairly universal, and very often the - is doubled if the flag's argument is more than a single letter (eg, -v and --verbose are often interchangeable).

The flags don't have much meaning in isolation from the command they modify, so hopefully it's clearer why you couldn't find information when googling on them by themselves. And finally, the man page for the man command says that the -d flag makes man print debugging information, so no, you didn't break anything.

share|improve this answer

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