Last modified: Mar, 2016
A collection of random but useful command lines. The OS is assumed to be Ubuntu.
To resize all images in one folder, first install imagemagick.
sudo apt-get install imagemagick
Then in the folder, run bash script:
for img in `ls *.JPG`
do
mogrify -resize 50% $img
done
About IPv6 related commands: at the time of writing (Mar, 2016) IPv6 is still in the adopting stage and not every server can talk in IPv6.
ssh -6 user@3509:5600:02e4:0000:0000:0000:098e:2abf
which is very similar to the traditional way.
ping6 ipv6.google.com
du -sch .[!.]* * |sort -h
find path_to_folder -type f -print0 | xargs -0 sed -i 's/patternA/patternB/g'
See this post for explanation.
diff -qr -x "*.o" -x "*.html" -x "*.bin" dir1 dir2
Here the “-x” flag excludes the files to be compared.
cat log.txt | tail -f