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

Test speaker channels
Useful tool to test if all speaker channels are working properly. speaker-test is part of alsa-utils package

Convert ascii string to hex
Converts the ascii text to hex from bash. Check the sample output.

Insert the last argument of the previous command
for example if you did a: $ ls -la /bin/ls then $ ls !$ is equivalent to doing a $ ls /bin/ls

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

check open ports without netstat or lsof

Replace spaces in a filename with hyphens
As long as you have perl based rename. You can check: =$ rename --help Unknown option: help Usage: rename [-v] [-n] [-f] perlexpr [filenames] That's the good one.

create tar archive of files in a directory and its sub-directories
creates a compressed tar archive of files in /path/foo and writes to a timestamped filename in /path.

Create new user with home dir and given password
The crypt function takes a password, key, as a string, and a salt character array which is described below, and returns a printable ASCII string which starts with another salt. It is believed that, given the output of the function, the best way to find a key that will produce that output is to guess values of key until the original value of key is found. from http://en.wikipedia.org/wiki/Crypt_(Unix)

delete a particular line by line number in file
deletes line 3 in known_hosts text file

Find usb device in realtime
Using this command you can track a moment when usb device was attached.


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: