bash_oneliners
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
bash_oneliners [2020/06/05 09:46] – admin | bash_oneliners [2020/06/10 15:26] – admin | ||
---|---|---|---|
Line 2: | Line 2: | ||
- | * Remove offending key from known_hosts file with one command | ||
- | < | ||
- | $ sed -i 18d .ssh/ | ||
- | </ | ||
* Whats my WAN IP? | * Whats my WAN IP? | ||
< | < | ||
- | $ dig +short myip.opendns.com @resolver1.opendns.com | + | dig +short myip.opendns.com @resolver1.opendns.com |
</ | </ | ||
* Find large files, print 10 largest files in dir | * Find large files, print 10 largest files in dir | ||
< | < | ||
- | $ find . -printf '%s %p\n' | + | find . -printf '%s %p\n' |
</ | </ | ||
* size of all files older than mtime | * size of all files older than mtime | ||
< | < | ||
- | $ find . -mtime +7 -print0 | du -hc --files0-from - | tail -n 1 | + | find . -mtime +7 -print0 | du -hc --files0-from - | tail -n 1 |
</ | </ | ||
* To find the largest file in all sub-directories: | * To find the largest file in all sub-directories: | ||
< | < | ||
- | $ find / | + | find / |
</ | </ | ||
* grep for valid IP Addresses. | * grep for valid IP Addresses. | ||
< | < | ||
- | $ grep -E -o " | + | grep -E -o " |
</ | </ | ||
* show used inode count for subdirectories. | * show used inode count for subdirectories. |
bash_oneliners.txt · Last modified: 2023/04/14 09:23 by admin