largest_files
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| largest_files [2015/05/05 11:24] – luke7858 | largest_files [2024/05/23 07:26] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====Largest files in file system==== | ====Largest files in file system==== | ||
| + | Quickly check the log file size: | ||
| + | <sxh bash> | ||
| + | du -sh /var/log | ||
| + | </ | ||
| + | Quickly check the home directory of a user: | ||
| + | <sxh bash> | ||
| + | du -sh /home/rack | ||
| + | </ | ||
| + | \\ | ||
| + | ---------------------------------------------- | ||
| + | === NEW IMPROVED === | ||
| + | one-liner (also checked for open (Deleted) files). | ||
| + | \\ | ||
| + | Change the "/" | ||
| + | <sxh bash> | ||
| + | filesystem="/"; | ||
| + | </ | ||
| + | \\ | ||
| + | --------------------------------------------------- | ||
| + | === List Open Deleted Files === | ||
| + | Print a list of all the deleted open files in MB: | ||
| + | <sxh bash> | ||
| + | lsof | awk '/REG/ && !/stat: No such file or directory/ && !/DEL/ {if ($NF==" | ||
| + | </ | ||
| + | \\ | ||
| + | ------------------------------------------------ | ||
| + | Show a break down of the system usage: | ||
| <sxh bash> | <sxh bash> | ||
| FS='/'; | FS='/'; | ||
| Line 9: | Line 36: | ||
| </ | </ | ||
| \\ | \\ | ||
| - | Excluding a specific directory: | + | === Excluding a specific directory: |
| + | Following shows the largest directories excluding / | ||
| <sxh bash> | <sxh bash> | ||
| du --exclude / | du --exclude / | ||
| $1/ | $1/ | ||
| + | \\ | ||
| === Other Command: === | === Other Command: === | ||
| <sxh bash> | <sxh bash> | ||
| + | \\ | ||
| + | |||
| + | \\ | ||
| + | -------------------------------------------------- | ||
| + | === INODES === | ||
| + | |||
| + | <sxh bash> | ||
| + | nice -n 19 find / -type d 2>/ | ||
| + | </ | ||
largest_files.1430825046.txt.gz · Last modified: 2024/05/23 07:26 (external edit)
