From 2739e257e183bbcbc09f228d88d5eab46eb1cd39 Mon Sep 17 00:00:00 2001 From: srdusr Date: Thu, 7 Sep 2023 23:09:12 +0200 Subject: Find top 10 largest files --- linux/linux-troubleshoot.md | 74 +++++++++++++++++++++++++++++++-------------- 1 file changed, 51 insertions(+), 23 deletions(-) diff --git a/linux/linux-troubleshoot.md b/linux/linux-troubleshoot.md index 088a7f7..6529e4f 100644 --- a/linux/linux-troubleshoot.md +++ b/linux/linux-troubleshoot.md @@ -1,44 +1,72 @@ ## Useful troubleshooting commands/tools -#### Internet/network: -- ifconfig (install net-tools) - - Manage interface configurations/parameters - - Enable/disable a network interface - - View all available interfaces, IP addresses, hardware addresses - - Assign an IP address and netmask to a selected interface -- ip - - Alternate to ifconfig, display network interfaces and configure network devices - - Interact with layers of TCP/IP protocol (Data link layer and Network layer) - - Can show and modify kernal routing tables (+/- ARP cache entries) -- - - -#### Reload a program from tty if gui becomes unresponsive + +#### Internet/network: + +- ifconfig (install net-tools) + - Manage interface configurations/parameters + - Enable/disable a network interface + - View all available interfaces, IP addresses, hardware addresses + - Assign an IP address and netmask to a selected interface +- ip + - Alternate to ifconfig, display network interfaces and configure network devices + - Interact with layers of TCP/IP protocol (Data link layer and Network layer) + - Can show and modify kernal routing tables (+/- ARP cache entries) + +--- + +#### Reload a program from tty if gui becomes unresponsive + ```bash -$ DISPLAY=: +$ DISPLAY=: ``` - Example: -``` bash -$ DISPLAY=:0 xterm & -$ DISPLAY=:0 sxhkd & + +Example: + +```bash +$ DISPLAY=:0 xterm & +$ DISPLAY=:0 sxhkd & ``` -- - - -#### Fix pacman keyring errors + +--- + +#### Fix pacman keyring errors + ```bash -$ pacman-key --init && pacman-key --populate archlinuxarm -$ rm /var/lib/pacman/db.lck +$ pacman-key --init && pacman-key --populate archlinuxarm +$ rm /var/lib/pacman/db.lck ``` -- - - + +--- + #### Clean package manager's cache (apt/pacman) + apt: + ```bash $ sudo apt-get clean $ sudo apt-get autoclean ``` + pacman: + ```bash $ paccache -r # requires pacman-contrib $ sudo pacman -Scc ``` -- - - + +--- + #### Unlocking a Linux User Account After Too Many Failed Attempts + ```bash $ faillock --user $USER --reset ``` + +--- + +#### Find top 10 largest files + +```bash +$ find /path/to/dir/ -printf '%s %p\n'| sort -nr | head -10 +$ find . -printf '%s %p\n'| sort -nr | head -10 +``` -- cgit v1.2.3