Commands using sudo (537)

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. 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.

Share Your Commands


Check These Out

List all files in a folder in a git repository by last commit date
This lists all the files in a folder, then finds the commit date for them one by one, then sorts them from newest to oldest

Current running process ordered by %CPU
Useful to detect which process is causing system loads. It shows process PID so as we can take further actions.

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Adding formatting to an xml document for easier reading
Sometimes you're trying to read through an xml file to determine whats wrong with it and a tool had removed all the linebreaks. xmllint will go ahead and make it pretty for you.

Stream audio over ssh
This one doesn't need to convert to wav.

Remote backups with tar over ssh
Execute it from the source host, where the source files you wish backup resides. With the minus '-' the tar command deliver the compressed output to the standar output and, trough over the ssh session to the remote host. On the other hand the backup host will be receive the stream and read it from the standar input sending it to the /path/to/backup/backupfile.tar.bz2

FizzBuzz One-liner

Draw a Sierpinski triangle
OK, not the most useful but a good way to impress friends. Requires the "display" command from ImageMagick.

determine if tcp port is open
Requires netcat.

List your MACs address


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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: