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

Short one line while loop that outputs parameterized content from one file to another

Yet Another Rename (bash function)
Implementation of `rename` for systems on which I don't have access to it.

NICs, IPs, and Mac
Needed to get the Mac of various devices on a solaris box, but didn't have root. This command used awk to display the Network device, the IP, and the MAC a line at a time.

Super Speedy Hexadecimal or Octal Calculations and Conversions to Decimal.
^Hexadecimal Ten minus Octal Ten is Eight(in Decimal). $ echo "$(( 0xaf )) = $(( 0257 ))" ^Hexadecimal AF and Octal 257 are both Decimal 175.

Resets a terminal that has been messed up by binary input

Generat a Random MAC address
Original author unknown (I believe off of a wifi hacking forum). Used in conjuction with ifconfig and cron.. can be handy (especially spoofing AP's)

Recursive search and replace (with bash only)
Replaces a string matching a pattern in one or several files found recursively in a particular folder.

Auto-log commands
A quick alias I use right before logging into a server so that I have a log of the transactions as well as the ability to re-connect from another computer. Useful for when your boss says "what commands did you run again on that server?" and you had already closed the terminal ;) I wrapped it in a script now, with more features, but this is the heart of it. Never leave home without it.

Get a list of ssh servers on the local subnet
Scan the local network for servers who have the ssh port open.

Find where a kind of file is stored
In this case searches for where .desktop files are stored. The resulted is a sorted list of the top directories containing such files.


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: