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.
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:
Wow, didn't really expect you to read this far down. The latest iteration of the site is in open beta. It's a gentle open beta-- not in prime-time just yet. It's being hosted over at UpGuard (link) and you are more than welcome to give it a shot. Couple things:
I often run some command that takes a while to finish. By putting the say command afterward, I get an audio notification.
Please note that this command (say) only works on Mac OS X and not Linux.
Compresses each file individually, creating a $fileneame.tar.gz and removes the uncompressed version, usefull if you have lots of files and don't want 1 huge archive containing them all. you could replace ls with ls *.pdf to just perform the action on pdfs for example.
In order to create a new encrypted filing system managed by cryptmount,
you can use the supplied 'cryptmount-setup' program, which can be used
by the superuser to interactively configure a basic setup.
Alternatively, suppose that we wish to setup a new encrypted filing
system, that will have a target-name of "opaque". If we have a free
disk partition available, say /dev/hdb63, then we can use this directly
to store the encrypted filing system. Alternatively, if we want to
store the encrypted filing system within an ordinary file, we need to
create space using a recipe such as:
dd if=/dev/zero of=/home/opaque.fs bs=1M count=512
cryptmount --generate-key 32 opaque
cryptmount --prepare opaque
cryptmount --release opaque
cryptmount -m opaque
cryptmount -u opaque
For detail see sample output
This counts all established sessions on port 80. You can change :80 to any port number you want to check.
This command lists all the directories in SEARCHPATH by size, displaying their size in a human readable format.
Files saved on a windows machine use different ascii characters for lines turns. When viewing such files in VI the will most often have a ^M(control-VM) character at the end of each line. This command will remove all occurrences of that character
Emacs backs up previous versions by default.
use it to stagger cronjob or to get a random number
increase the range by replacing 100 with your own max value
just replace the number 5 with the variable you want , and the xpenguins software with the one you want
Nothing special about hashing here, only the use of cut, I think, could result at fewer keystrokes.
executed on SLES 11.2
Run this in your music folder, or give the path directly after "find".
The sed pattern filters away the basename.
The same as the other user, but smarter, using -d and -f
Command to create a dummy file (full of nulls). Useful for testing e.g. file transfers when no file is at hand.
bs = blocksize, count = filesize in kilobytes
unrar e ... extracts all files into current directory, without archived subdirectories order. unrar x is more accurate command.
Depending on your installation, when you run ps you will only get the first 40 or so characters displayed. In order to view the entire string, use /usr/ucb/ps on Solaris.
Of course, this command must be executed at a GRID User Interface
lhcb - name of your VO, substitute it with the one you are interested it.
This obtains a list of open connections that a user is connected to if he/she is using a SSH tunnel
Use find's built-in "exec" option to avoid having to do any weirdness with quoting.
this command is used to locate all pom.xml files, access the dir and do a mvn clean, but I do recommend you to disable network interfaces to not download dependencies packages to be faster.