What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world.
That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and
voted up or down.

Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted
to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning,
there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

Add a line for your username in the /etc/sudoers file, allowing you to sudo in Fedora

I am new to linux, and I was trying to figure out why I could not sudo with my username in Fedora 10. This command, when run as root, will add a line to the sudoers file allowing the loginname supplied to sudo. The above line will require a password when you sudo, if you wish to sudo without password, use:

echo 'loginname ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

instead. you have to run this command as su, and this is just an easier way of using visudo, just adds it right from the terminal.

@koukos Sudo is not a wrong idea. Sudo has been around long before Ubuntu. Mac OS X, for example, has been using sudo since day one, further by disabling root entirely (as does Ubuntu). Most major distributions and Unix derivatives ship sudo. Just because Ubuntu has made sudo popular doesn't make it a problem. Sudo has many advantages over just plain 'su - root':

1) It logs the actions of who is performing the command.

2) You can enforce granular control over who has access to what command and what hosts.

3) It creates a mindset of using least privilege, and preventing root logins.

@maht I'll argue that with you. While the paradigm of an all-powerful user 'root', then everyone else is unfortunate, it's been addressed through the wheel group, sudo, and RBAC. Unix today is 100x better than it was 20 years ago. The root account now means more than it did.

For @refrax who submitted the command, as people have already mentioned, 'visudo' is the tool you want to use, so you can check syntax errors. If a tool exists for editing a configuration file, then the tool should be used. 'visudo' is it.