Check These Out
Yeah I know it's been up here a million times, but this service is a really clean and nice one. Nothing but your IP address on it. Actually I was to write something like this, and noticed this on appspot... ;)
Console screensaver.
This modifies the output of ls so that the file size has commas every three digits. It makes room for the commas by destructively eating any characters to the left of the size, which is probably okay since that's just the "group".
Note that I did not write this, I merely cleaned it up and shortened it with extended regular expressions. The original shell script, entitled "sl", came with this description:
: '
: For tired eyes (sigh), do an ls -lF plus whatever other flags you give
: but expand the file size with commas every 3 digits. Really helps me
: distinguish megabytes from hundreds of kbytes...
:
: Corey Satten, corey@cac.washington.edu, 11/8/89
: '
Of course, some may suggest that fancy new "human friendly" options, like "ls -Shrl", have made Corey's script obsolete. They are probably right. Yet, at times, still I find it handy. The new-fangled "human-readable" numbers can be annoying when I have to glance at the letter at the end to figure out what order of magnitude is even being talked about. (There's a big difference between 386M and 386P!). But with this nifty script, the number itself acts like a histogram, a quick visual indicator of "bigness" for tired eyes. :-)
Using this command you can track a moment when usb device was attached.
if you want to move with command mv large list of files than you would get following error
/bin/mv: Argument list too long
alternavite with exec:
find /source/directory -mindepth 1 -maxdepth 1 -name '*' -exec mv {} /target/directory \;
You have a script where =ALL= STDERR should be redirected to STDIN and you don't want to add "2>&1" at the end of each command...
E.G.:
$ ls -al /foo/bar 2>&1
Than just add this piece of code at the beginning of your script!
I hope this can help someone. :)
This command will copy files and directories from a remote machine to the local one.
Ensure you are in the local directory you want to populate with the remote files before running the command.
To copy a directory and it's contents, you could:
$ ssh user@host "(cd /path/to/a/directory ; tar cvf - ./targetdir)" | tar xvf -
This is especially useful on *nix'es that don't have 'scp' installed by default.
Scrap everything and use `gawk` to do all the magic, since it's like the future or something.
$ gawk 'match($11, /[a-z]{3}$/) && match($9, /^ata-/) { gsub("../", ""); print $11,"\t",$9 }'
Yank out only ata- lines that have a drive letter (ignore lines with partitions). Then strip ../../ and print the output.
Yay awk. Be sure to see the alternatives as my initial command is listed there. This one is a revision of the original.
Use set +o noclobber and you will be able to replace files again