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

temporarily override alias of any command
say, someone has aliased ls to 'ls --color=always' and you want to temporarily override the alias (it does not override functions)

Remove all leading and trailing spaces or tabs from all lines of a text file
Bash only, no sed, no awk. Multiple spaces/tabs if exists INSIDE the line will be preserved. Empty lines stay intact, except they will be cleaned from spaces and tabs if any available.

MySQL dump restore with progress bar and ETA
Display a progress bar while restoring a MySQL dump.

AWK Calculator

Creating shortened URLs from the command line

Short one line while loop that outputs parameterized content from one file to another
There is a common command for outputting a field or list of fields from each line in a file. Why wouldn't you just use cut?

Convert a date to timestamp
Simple way to get a timestamp from a date

Get last sleep time on a Mac

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

BourneShell: Go to previous directory
cd - would return to the previous directory of your cd command. NB: previous dir is always stored in $OLDPWD variable.


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: