linux notes and useful commands
size of files in directory: du -sh
sudo du -sh * | sort -h
tr
reset
!! is last command eg. sudo !! to rerun as sudo.
ctrl-k remove end to cursor ctrl-x backspace remove beginning to cursor ctrl-y paste in copied ctrl-w or alt-backspace remove last word alt-. pastes previous command's argument. good for runnning another program.
eg. type command and want sudo. Ctrl-u sudo ctrl-u
Tailing. tail -f var/log/syslog less +f var/log/syslog shift F to reattach after scolling to move to bottom.
ctrl-x-e changes line editor to multi-line text editor to write command.
s line editor to multi-line text editor to write command.