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

List your MACs address
List all MAC addresses on a Linux box. sort -u is useful when having virtual interfaces.

retab in vim, tab to space or space to tab, useful in python
usage: :[rang]ret[!][tabstop value] python is indent sensitive, after command :set list you may see your codes are mixed with tab and space ret can help you to convert space to tab or tab to space

Sniffing network to generate a pcap file in CLI mode on a remote host and open it via local Wireshark ( GUI ).
Then hit ^C to stop, get the file by scp, and you can now use wireshark like this : $ wireshark /tmp/sniff.pcap If you have tshark on remote host, you could use that : $ wireshark -k -i

quickest (i blv) way to get the current program name minus the path (BASH)
Useful in shell scripts when you're trying to get the shell script name without the full path - and easier than awking or cutting. Bash pattern matching and variable manip is fun.

Download files linked in a RSS feed
The difference between the original version provided and this one is that this one works rather than outputting a wget error

Execute a file in vim with the #!/bin/interpreter in the first line

Debug redirects between production reloads
Watches the headers of a curl, following any redirects and printing only the HTTP status and the location of the possible redirects.

Calculate days on which Friday the 13th occurs (inspired from the work of the user justsomeguy)
Friday is the 5th day of the week, monday is the 1st. Output may be affected by locale.

Remove the first character of each line in a file

Route outbound SMTP connections through a addtional IP address rather than your primary


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: