Commands by truemilk (3)

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

fork performance test
grabbed from Andrew Aylett post: http://superuser.com/questions/133313/can-i-speed-up-cygwins-fork

Convert embedded spaces in filenames to "_" (underscore)
This command converts filenames with embedded spaces in the current directory replacing spaces with the underscore ("_") character.

Have subversion ignore a file pattern in a directory
If you don't want to commit files to subversion, and don't want those file to show up when doing an "svn stat", this command is what you need

Watch active calls on an Asterisk PBX
Show active calls as the happen on an Asterisk server. Note that the Asterisk command (in single quotes) is formatted for Asterisk 1.6. Use the -n flag on the watch command to modify the refresh period (in seconds - default is 2 seconds).

list all file extensions in a directory
If your grep doesn't have an -o option, you can use sed instead.

Hear the mice moving
Beeps on mouse's every move. Bear in mind that, at least on Ubuntu, /dev/input/mice can be read only by root.

list block devices
Shows all block devices in a tree with descruptions of what they are.

Network Proxy to dump the application level forward traffic in plain text in the console and in a file.
If you have a client that connects to a server via plain text protocol such as HTTP or FTP, with this command you can monitor the messages that the client sends to the server. Application level text stream will be dumped on the command line as well as saved in a file called proxy.txt. You have to change 8080 to the local port where you want your client to connect to. Change also 192.168.0.1 to the IP address of the destination server and 80 to the port of the destination server. Then simply point your client to localhost 8080 (or whatever you changed it to). The traffic will be redirected to host 192.168.0.1 on port 80 (or whatever you changed them to). Any requests from the client to the server will be dumped on the console as well as in the file "proxy.txt". Unfortunately the responses from the server will not be dumped.

Batch rename extension of all files in a folder, in the example from .txt to .md
Same thing using bash built-in features instead of a sub-shell.

Find the date of the first commit in a git repository
Finds the date of the first commit in a git repository branch


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: