0
score
|
Print file owners and permissions of a directory tree$ find /path/to/dir1 -printf "%U %G %m %p\n" > /tmp/dir1.txt |
0
score
|
Get only the latest version of a file from across mutiple directories$ find . -name custlist\* | perl -ne '$path = $_; s?.*/??; $name = $_; $map{$name} = $path; ++$c; END { print $map{(sort(keys(%map)))[$c-1]} }' |
0
score
|
Recreate or update an existing zip file and remove files that do not exist anymore$ zip --filesync -r /path/to/out.zip /path/to/dir |
0
score
|
How to expand a CIDR notation to its IPs$ for j in $(seq 0 255); do for i in $(seq 0 255) ; do seq -f "10.$j.$i.%g" 0 255; done; done |
0
score
|
Make the output of the `time` builtin easier to parse$ TIMEFORMAT=%R |
0
score
|
Remove EXIF data such as orientation from images$ mogrify -strip /path/to/image.jpg |
0
score
|
Get the last modification date of a file in any format you want$ date -r /etc/motd +%Y%m%d_%H%M%S |
0
score
|
Forget all remembered path locations$ hash -r |
0
score
|
Rename files with numeric padding$ perl -e 'for (@ARGV) { $o = $_; s/\d+/sprintf("%04d", $&)/e; print qq{mv "$o" "$_"\n}}' |
0
score
|
Copy or create files with specific permissions and ownership$ install -b -m 600 /dev/null NEWFILE |
0
score
|
Run command multiple times with a for loop and a sequence expression$ for i in {1..10}; do date; sleep 1; done |
0
score
|
Clear the swap space forcing everything back to main memory in Linux$ sudo swapoff -a; sudo swapon -a |
0
score
|
Redirection operator to override the noclobber option$ some_command >| output.txt |
0
score
|
How to set the ip address in Solaris 11$ ipadm create-addr -T static -a 192.168.1.10/24 eth0/staticaddr |
0
score
|
Edit the Gimp launcher file to disable the splash screen$ sudo sed -i 's/^Exec=[^ ]*/& -s/' /usr/share/applications/gimp.desktop |
0
score
|
`less` is more convenient with the `-F` flag$ less -F FILE1 |
0
score
|
Append to a file text, a blank line, and the last line of another file$ { echo some text; echo; tail -n1 /var/log/apache2/error.log; } >> /path/to/file |
0
score
|
Append to a file text, a blank line, and the last line of another file$ echo -e "From: me\n\n$(tail -n1 /var/log/apache2/error.log)" >> file |
0
score
|
Convert a list of terms in slug format to capitalized words$ sed -e 's/^./\U&/' -e 's/_./\U&/g' -e 's/_/ /g' /path/to/input |
0
score
|
Execute different commands with find depending on file type$ find /path/to/dir -type d -exec chmod 0755 '{}' \; -o -type f -exec chmod 0644 '{}' \; |
0
score
|
Convert m4a files to mp3 using faad and lame$ faad -o tmp.wav music.m4a && lame -b 192 tmp.wav music.mp3 |
0
score
|
Write both stdout and stderr to the same file$ do_something.sh &> out.log |
0
score
|
Create or mount an encrypted directory using encfs$ encfs -i 5 $PWD/raw $PWD/content |
0
score
|
Run a never-ending process in the background in a way that you can check on its status anytime$ screen -d -m -S some_name ping my_router |
0
score
|
Make a hexdump or do the reverse with the xxd command$ xxd /path/to/binary/file |