Check These Out
or
echo '127.0.0.1 facebook.com' | sudo tee -a /etc/hosts
Do not execute this command if you don't know what you are doing.
replaces "\n" with "+"
This is super fast and an easy way to test your terminal for 256 color support. Unlike alot of info about changing colors in the terminal, this uses the ncurses termcap/terminfo database to determine the escape codes used to generate the colors for a specific TERM. That means you can switch your terminal and then run this to check the real output.
$ tset xterm-256color
at any rate that is some super lean code!
Here it is in function form to stick in your .bash_profile
aa_256 ()
{
( x=`tput op` y=`printf %$((${COLUMNS}-6))s`;
for i in {0..256};
do
o=00$i;
echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x;
done )
}
From my bash_profile: http://www.askapache.com/linux-unix/bash_profile-functions-advanced-shell.html
Looks best in an 80x24 256-color terminal emulator.
This command is a great way to check to see if acpi is doing damage to your disks by agressivly parking the read arm and wearing down it's life. As you can see, mine has lost half its life. I'm sure this could be shortened though somehow. It will use smartctl to dump the stats and then grep out just the temperature and load cycles for the disk (a load cycle is when a the read arm comes out of park and wears on the drive).
If you use the logfile feature of ddrescue, the data is rescued very efficiently (only the needed blocks are read). Also you can interrupt the rescue at any time and resume it later at the same point.
http://www.gnu.org/software/ddrescue/ddrescue.html
ls -Q will show the filenames in quotes. xargs -p rm will print all the filenames piped from ls -Q and ask for confirmation before deleting the files.
without the -Q switch, if we have spaces in names, then the files won't be deleted.
making it "sound" more "natural" language like -- additionally sorting the longest words alphabetically:
this approach is using:
* to get at all lines of input
* post-"for" structure
* short-circuit-or in sort: if the lengths are the same, then sort alphabetically otherwise don't even evaluate the right hand side of the or
* -C sets all input and ouput channels to utf8
Using this command you can track a moment when usb device was attached.