Check These Out
An alias cannot be executed as command in a find -exec line. This form will trick the command line and let you do the job.
Extract a color palette from a image useful for designers.
Example usage:
$extract-palette myawesomeimage.jpg 4
Where the first argument is the image you want to extract a palette from. The second argument is the number of colors you want.
It may be the case where you want to change the search space. In that case, change the -resize argument to a bigger or smaller result. See the ImageMagick documentation for the -resize argument.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
Handle any bad named file which contains ",',\n,\b,\t,` etc
Store the file name as null character separated list
$find . -print0 >name.lst
and retrieve it using
$read -r -d ""
Eg:
$find . -print0 >name.lst;
$cat name.lst| while IFS="" read -r -d "" file;
$do
$ls -l "$file";
$done
Really helpfull when play with files having spaces an other bad name. Easy to store and access names and path in just a field while saving it in a file.
This format (URL) is directly supported by nautilus and firefox (and other browsers)
This command finds and prints all the symbolic and hard links to a file. Note that the file argument itself be a link and it will find the original file as well.
You can also do this with the inode number for a file or directory by first using stat or ls or some other tool to get the number like so:
$ stat -Lc %i file
or
$ ls -Hid file
And then using:
$ find -L / -inum INODE_NUMBER -exec ls -ld {} +
Sort ls output of all files in current directory in ascending order
Just the 20 biggest ones:
$ ls -la | sort -k 5bn | tail -n 20
A variant for the current directory tree with subdirectories and pretty columns is:
$ find . -type f -print0 | xargs -0 ls -la | sort -k 5bn | column -t
And finding the subdirectories consuming the most space with displayed block size 1k:
$ du -sk ./* | sort -k 1bn | column -t
Will colorize your svn diff.