All commands (14,187)

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

a fast way to repeat output a byte
I'm both a one-liner fan and a haskell learner

generate a randome 10 character password

shell bash iterate number range with for loop

Pick a random line from a file

Show max lengths of all fields in a pipe delimited file with header row

Update grub menu.lst
Remove all commented lines Remove all blank lines Show the menu Up the delay so you have enough time to select a kernel Remove the quiet so you can watch the entire boot Add a rootdelay for san attached storage booting

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"

Compress a series of png pictures to an avi movie.
cd /path/to/your/png_pics mencoder "mf://*.png" -mf fps=2 -o output.avi -ovc lavc -lavcopts vcodec=mpeg4 then you can get a movie named output.avi.

encode image to base64 and copy to clipboard
I use it for embedding images in CSS for Stylish, the Firefox addon. Thought it might be useful to others.

Convert CSV to JSON - Python3 and Bash function
Based / Inspired by malathion's below command http://www.commandlinefu.com/commands/view/20528/convert-csv-to-json Is written for python3 and is very easy to use csv2json *csv will convert all files ending in csv to json eg csv2json file.csv will output a file to file.json Validity of json tested in python3 and below site https://jsonformatter.curiousconcept.com/


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: