mirror of
https://github.com/Erreur32/cheat.git
synced 2024-12-23 06:02:12 +01:00
Adding additional find commands
This commit is contained in:
parent
0cc76a78a1
commit
bbab921bf8
1 changed files with 12 additions and 0 deletions
|
@ -24,3 +24,15 @@ find ./ -size +5M -type f -print0 | xargs -0 ls -Ssh
|
||||||
|
|
||||||
# To find files bigger thank 2 MB and list them:
|
# To find files bigger thank 2 MB and list them:
|
||||||
find / -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
|
find / -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
|
||||||
|
|
||||||
|
# To find files modified more than 7 days ago and list file information
|
||||||
|
find . -type f -mtime +7d -ls
|
||||||
|
|
||||||
|
# To find symlinks owned by a user and list file information
|
||||||
|
find . -type l --user=username -ls
|
||||||
|
|
||||||
|
# To search for and delete empty directories
|
||||||
|
find . -type d -empty -exec rmdir {} \;
|
||||||
|
|
||||||
|
# To search for directories named build at a max depth of 2 directories
|
||||||
|
find . -maxdepth 2 -name build -type d
|
||||||
|
|
Loading…
Reference in a new issue