--- title: Linux Examples toc_enable: yes breadcrumbs: - title: Home url: / - title: Configuration url: /config/ - title: PC --- {% include header.md %} ### Using {:.no_toc} Debian 10 Buster ## Commands ### File Systems and Logical Volume Managers - Partition disk: `gdisk ` (GPT) or `fdisk ` (MBR) - Create filesystem: `mkfs. ` - ZFS: See ZFS (**TODO**). ### Files - Find files: - By UID: `find / -user ` - Without a user: `find / -nouser` - With setuid permission bit: `find / -perm /4000` - Recursive search and replace: `find ( -type d -name .git -prune ) -o -type f -print0 | xargs -0 sed -i 's/123/456/g'` - `( -type d -name .git -prune ) -o` skips `.git` directories and can be excluded outside of git repos. ### Fun - Pretty colors: `something | lolcat` ### Hardware - Check if hard drives are spinning: `smartctl -i -n standby /dev/sdc | grep "^Power mode"` - "Active" and "idle" means most likely spinning, "standby" and "sleeping" means most likely not spinning. - Get physical block size of drive: `hdparm -I /dev/sda | grep -i physical` ### Installations and Packages - Find packages depending on the package: `apt rdepends --installed ` ### Processes and Memory - Useful ps args: `ps ax o uid,user:12,pid,comm` ## Tasks ### Burn Windows ISO 1. Install the graphical application `woeusb` from `ppa:nilarimogard/webupd8`. {% include footer.md %}