0
score
|
Expire a user's password immediately$ chage -d 0 USERNAME |
0
score
|
Convert any 16:9 video to play on a QHD widescreen Android phone$ ffmpeg -i $1 -y -threads 0 -subq 6 -deinterlace -level 30 -f mp4 -acodec libfaac -ab 160k -ar 24000 -ac 2 -vcodec libx264 -b 1000k -maxrate 1000k -bufsize 2000k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -coder 0 -refs 2 -flags +loop -vol 256 -trellis 1 -me_method umh -async 1 $2 |
0
score
|
Sort du output in Human-readable format$ for i in G M K; do du -hsx * | grep "[0-9]$i\b" | sort -nr; done 2>/dev/null |
0
score
|
Sort du output in Human-readable format$ for i in $(echo -e 'G\nM\nK'); do du -hsx /* 2>/dev/null | grep '[0-9]'$i | sort -rn; done |
0
score
|
Convert a decimal number to octal, hexadecimal, binary, or anything$ echo 'obase=2;1234' | bc |
0
score
|
Convert from avi format to mp4 encoding$ ffmpeg -i file.avi file.mp4 |
0
score
|
Format input into multiple columns, like a table, useful or pretty-printing$ mount | column -t |
0
score
|
Function to extract columns from an input stream$ col() { awk '{print $'$(echo $* | sed -e 's/ /,$/g')'}'; } |
0
score
|
Resize an image proportionally to some specified width or height$ mogrify -geometry x31 path/to/image.gif |
0
score
|
Do something in another directory without going there$ (cd /path/to/somewhere; tar c .) > somewhere.tar |
0
score
|
Remove carriage return '\r' character in many files, without looping and intermediary files$ recode pc..l1 file1 file2 file3 |
0
score
|
Find the target path a symlink is pointing to$ readlink a_symbolic_link_to_somewhere |
0
score
|
0
score
|
0
score
|
Find the most recently modified files in a directory and all subdirectories$ find /path/to/dir -type f -mtime -7 -print0 | xargs -0 ls -lt | head |
0
score
|
List open files$ lsof -n |
0
score
|
Set a colorful bash prompt per dev test prod environments$ PS1='\[\e[1;31m\][\u@\h \W]\$\[\e[0m\] ' |
0
score
|
Print the lines of file2 that are missing in file1$ grep -vxFf file1 file2 |
0
score
|
Find in files, recursively$ find /etc -type f -print0 2>/dev/null | xargs -0 grep --color=AUTO -Hn 'nameserver' 2>/dev/null |
0
score
|
Concatenate PDF files using GhostScript$ gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=output.pdf -dBATCH file1.pdf file2.pdf file3.pdf |
0
score
|
Format text with long lines to text with fixed width$ fmt -s -w80 file.txt |
0
score
|
Come back quickly to the current directory after doing some temporary work somewhere else$ pushd /some/where/else; work; cd /somewhere; work; cd /another/place; popd |
0
score
|
Export a git project to a directory$ git archive master | tar x -C /path/to/dir/to/export |
0
score
|
Delete all tables of a mysql database$ mysql --defaults-file=my.cnf -e 'show tables' | while read t; do mysql --defaults-file=my.cnt -e 'drop table '$t; done |