linux:start
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
linux:start [2023-08-26 14:13] – dave | linux:start [2024-02-27 15:19] (current) – dave | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Linux ====== | ====== Linux ====== | ||
Info on that horrible operating system that's a million times better than Micro$oft Windoze. Why do I say it's horrible? Mostly because I don't spend enough time there to know how to do things and figuring it out is often a PITA. | Info on that horrible operating system that's a million times better than Micro$oft Windoze. Why do I say it's horrible? Mostly because I don't spend enough time there to know how to do things and figuring it out is often a PITA. | ||
+ | |||
+ | * [[Bash]] | ||
+ | * [[inputrc]] | ||
+ | * [[Services]] | ||
+ | * [[rclone]] | ||
+ | |||
+ | ----------------------- | ||
+ | ===== Commifying a number in Linux ===== | ||
+ | < | ||
+ | grep MemTotal / | ||
+ | </ | ||
+ | Bonus: That particular command tells you how much memory is installed. I think. | ||
+ | ----------------------- | ||
+ | ===== Pad IPs to Make Them Sortable ===== | ||
+ | < | ||
+ | echo 172.16.16.112/ | ||
+ | 172.016.016.112/ | ||
+ | </ | ||
+ | ----------------------- | ||
+ | ===== Date ===== | ||
+ | My preferred date/time format is ISO 8601. | ||
+ | < | ||
+ | Can also be accomplished with... | ||
+ | < | ||
+ | Specific timezone and 3 hours in the future... | ||
+ | < | ||
+ | ----------------------- | ||
+ | ===== Find ===== | ||
+ | I never remember how to find old files... either of these will work. The second one uses minutes (I don't know why you'd want to) and shows how to exclude files. | ||
+ | find DIR -name " | ||
+ | find . ! -name ' | ||
+ | |||
+ | Add this to the end and anything that matches will be deleted. | ||
+ | < | ||
+ | -exec rm -f {} \; | ||
+ | </ | ||
+ | |||
+ | Limit depth to current directory. | ||
+ | < | ||
+ | find . -maxdepth 1 -name " | ||
+ | </ | ||
+ | |||
+ | # to delete empty dirs | ||
+ | < | ||
+ | find -type d -empty -delete | ||
+ | </ | ||
+ | # to delete files over some age & empty dirs | ||
+ | < | ||
+ | find /some/path -depth \( \( -type f -daystart -mtime +100 \) -o -type d -empty \) -ls | ||
+ | </ | ||
+ | |||
+ | ----------------------- | ||
+ | ===== Find the Fat Folder ===== | ||
+ | Useful for finding which directory is sucking up all your disk space. | ||
+ | < | ||
+ | du -h --max-depth=1 | sort -hr | ||
+ | </ | ||
linux/start.1693059200.txt.gz · Last modified: 2023-08-26 14:13 by dave