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 |
0
score
|
Really lazy way to print the first instance of $foo that occurs after $bar$ ifconfig | grep ^en1 -A5 | grep inet | head -n 1 |
0
score
|
Print the first instance of $foo that occurs after $bar$ sed -n '\@interface Ethernet3/1@,/!/ s/ip address/&/p' file... |
0
score
|
Print the first instance of $foo that occurs after $bar$ awk '/interface Ethernet3\/1/ {instanza=1} /!/ {instanza=0} instanza && /ip address/ {print}' file... |
0
score
|
Sort du output in Human-readable format$ du -hsx * | sort -rh |