commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
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