commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. 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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
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.
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:
Simply translates whitespace to newlines. Could be enhanced to compress out extra newlines, but that might be better handled in the next tool down the pipe, with eg uniq(1).
Remove annoying improperly packaged files that untar into the incorrect directory.
Example, When you untar and it extracts hundreds of files into the current directory.... bleh.
Basically it creates a typical word list file from any normal text.
When I make a latex document, I need to compile three times for generate an updated index of contents. With ruby on command line, I run this operation with a fast one liner.
Update twitter from commandline, without revealing your password and without having to type it interactively.
You 'll need to put a line "machine twitter.com login TWITTERUSER password TWITTERPASS" in $HOME/.netrc and better chmod 600 that file.
Creates a PDF (over ps as intermediate format) out of any given manpage.
Other useful arguments for the -T switch are dvi, utf8 or latin1.
This will create a permanent alias to colorize the search pattern in your grep output
This will backup the _contents_ of /media/SOURCE to /media/TARGET where TARGET is formatted with ntfs. The --modify-window lets rsync ignore the less accurate timestamps of NTFS.
Handy use of bc in the command line. No need to get 'into' the bc to perform calculations
If you do not use this command, portage will fetch the source again, and rebuild the hole application from the top.
This command make portage keep all files that ar allready built
If you want a visual representation of the parent/child relationships between processes, this is one easy way to do it. It's useful in debugging collections of shell scripts, because it provides something like a call traceback.
When a shell script breaks, just remember "awwfux".
Find which package a file belongs to on Solaris along with it's packaging system metadata.
Logtool is a nice tool that can export log file to various format, but its strength lies in the capacity of colorize logs. This command take a log as input and colorize it, then export it to an html file for a more confortable view. Logtool is part of logtool package.Tested on Debian.
: new command allow to split a Vim screen in two separate windows. Each window can handle its own buffer.
Passing the -c new options when Vim start cause to split screen automatically.
Nload is part of nload package, tested under Debian. Nload display network bandwidth statistics, -u m options stands for MBit unit measure.
you don't need to echo, just a plain redirect is enough to empty the file
Empties all files in /var/log over 5000k. Useful if /var goes crazy or if you just haven't cleaned up in a while.
sudo ipfw pipe 1 config bw 50KByte/s
Set the bandwidth (bw) limit to any number you want. For example you could have a 15kb pipe for X application and then a 100kb pipe for another application and attach things to those pipes. If a port isn’t attached to a pipe, it runs at full speed. Change the number (in this case 1) to a different number for a different pipe.
The next step is to attach your port.
sudo ipfw add 1 pipe 1 src-port 80
In this case anything on port 80 (http) will be set to a limit of 50Kbyte/s. If you want to attach a second port to this pipe, repeat the command but change the port number at the end.
This will compress the root directory to an external hard drive and split it to parts once it reaches the 4 Gigs file system limit.
You can simply restore it with:
restore ivf /media/My\ Passport/Fedora10bckup/root_dump_fedora