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:
Change ~/tmp to the destination directory, such as your mounted media. Change -n20 to whatever number of files to copy. It should quit when media is full. I use this to put my most recently downloaded podcasts onto my phone.
Get the complete distro information from shell prompt like distributor ID,code name etc.
Sometimes you have to browse your way through a lot of sub-directories. This command cd to the next sub-directory in alphabetical order. For example, if you have the directories "lectures/01-intro", "lectures/02-basic", "lectures/03-advanced" and so on, and your PWD is "02-basic", it jumps to "03-advanced".
replace "/usr/src/linux/kernel/signal.c" with any file you want and listen to its output ! :P
you can also replace "cat" with "echo" or anything you can come up with
have fun :-}
find largest file in /var
This command creates an unmirrored pool using
files. While not recommended, a pool based on files can be
useful for experimental purposes.
command creates a pool with two mirrors, where each mirror contains two disks.
The following command creates a pool with a single raidz root vdev that consists of six disks.
Substitute whatever track number you want into the "dvd://1" parameter. The "-aid 128" is to select the English language.
Useful to know, especially if you are dealing with output configurations in block size.
Tested on 'Red Hat'.
It copies the entire current working directory to the destination directory with compression enabled.
Create a directory named with the current date in ISO 8601 format (yyyy-mm-dd). Useful for storing backups by date. The --iso switch may only work with GNU date, can use format string argument for other date versions.
A good way to understand what you've let yourself in for. Potential project metric could be the count:
svn log | grep -c "bodge\|fudge\|hack\|dirty"
automatically add and remove files in subversion so that you don't have to do it through the annoying svn commands anymore
Schedule your Mac to sleep at any future time.
Also wake, poweron, shutdown, wakeorpoweron. Or repeating with
sudo pmset repeat wakeorpoweron MTWRFSU 7:00:00
pmset -g sched
alt + number + dot will insert last command argument at $number place, alt + 0 + . will print last command name. For example
ls /tmp /var
ls /usr /home
alt + 1 + . will result in '/usr' , if you press alt + . again, it will result in '/tmp'
alt + 0 + . -> 'ls'
ec commits changes to etckeeper
must have etckeeper installed with bzr to use this
place inside bashrc
can be used from any directory to commit changes