Check These Out
With the force options the same results can be achieved
This allows the output to be sorted from largest to smallest in human readable format.
These commands will mark a file as hidden or visible to Mac OS X Finder. Notice the capitol V vs the lowercase v. This will also work for directories.
setfile -a V foo.bar; // This marks the file invisible
setfile -a v foo.bar; // This marks the file visible
I have also found that adding the following aliases are helpful:
alias hide='setfile -a V'
alias show='setfile -a v'
wget/curl/friends are not good with mirroring files off websites, especially those with Apache-generated directory listings. These tools endlessly waste time downloading useless index HTML pages. lftp's mirror command does a better job without the mess.
The above url contains over 6700 of the common ad websites. The command just pastes these into your /etc/hosts.
Makes any files in the current directory (and any sub-directories) group-readable.
Using the "! -perm /g=r" limits the number of files to only those that do not already have this property
Using "+" on the end of the -exec body tells find to build the entire command by appending all matching files before execution, so invokes chmod once only, not once per file.
This command works by rsyncing the target directory (containing the files you want to delete) with an empty directory. The '--delete' switch instructs rsync to remove files that are not present in the source directory. Since there are no files there, all the files will be deleted.
I'm not clear on why it's faster than 'find -delete', but it is.
Benchmarks here: https://web.archive.org/web/20130929001850/http://linuxnote.net/jianingy/en/linux/a-fast-way-to-remove-huge-number-of-files.html
I always add this to my .profile rc so I can do things like: "vim *.c" and the files are opened in tabs.
ItemsListtoAvoid (A) could be a list of files with a special characteristic to exclude. It can be a result of previous processing list, ex. a list of files containing a special string.
AlItemsList.txt (B) Is a complete list of items including some or all items in A.
$Difference is saved in ItemsDifference.txt
This command list and sort files by size and in reverse order, the reverse order is very helpful when you have a very long list and wish to have the biggest files at the bottom so you don't have scrool up.
The file size info is in human readable output, so ex. 1K..234M...3G
Tested with Linux (Red Hat Enterprise Edition)