Some shortcuts for Linux
Here’s the table of contents:
- Show size of folders using du
- Show installed packages when using apt
- Show differences between folders
- Run linux command from python and get the output
Show size of folders using du
du -chs * --exclude=/media --exclude=/mnt | sort -h
Show installed packages when using apt
apt list --installed
Show differences between folders
diff -qr dir1 dir2
Run linux command from python and get the output
import subprocess
result = subprocess.run(['ls', '-l'], stdout=subprocess.PIPE)
result.stdout