Unusual Tasks With File Listings
When you create a new GPG key it wants you to wiggle the mouse or pound the keyboard or do something to create enough entropy to create a well-randomized key. There is an easy way, and that is to use thels
command to recursively list every file on your system:$ ls -R /Do this in a separate terminal, and then you don't have to do silly tiring things like wiggling mice. While we're on the subject of the
ls
command, you can list multiple directories in a single command by using simple wildcards:$ sudo ls -l /var/*/*/You can skip over subdirectories, as this example shows:
$ sudo ls -l /var/.../*/I'm sure I copied this one from somewhere-- It draws a nice ASCII file tree of all subdirectories of the current directory:
$ find . -type d |sed 's:[^-][^/]*/:--:g; s:^-: |:'
Find Duplicate Files
The sure-fire way to find duplicate files is by comparing MD5 hashes. This compares only the first 20 characters of the md5sum, but it still takes a long time. It's the most accurate method, so I don't mind the wait:$ find . -type f -exec md5sum '{}' ';' | sort | uniq --all-repeated=separate -w 20You can also compare file sizes, which is a little less accurate but a lot faster:
$ find . -type f -printf "%p - %s" | sort -nr -k3 | uniq -D -f1I use the first method when I start accumulating a lot of sloppy backups, and have too many copies of the same files littering my backup servers.
Find more here
https://www.linux.com/learn/docs/660651-bag-of-fun-and-useful-random-linux-comman
--
Thanks and Regards
Bhaskar Ramaraju
http://www.linkedin.com/in/ramarajubhaskar
No comments:
Post a Comment