bash tips
- Showing file/directory size on the current directory.
du -sh * | sort -h
- Show device-type about current directory.
df . | awk 'NR==2{print $1}' | sed 's|/dev/||' | xargs -I{} sh -c 'echo -n "{}: " && awk "{print (\$1==0?\"SSD\":\"HDD\")}" /sys/block/{}/queue/rotational'
- send data with bandwidth limit 0.5G.
rsync -aHAX --info=progress2 --delete --partial --bwlimit=524288 -e "ssh -p 22" /path/to/src user@ip:~/projects/