Wednesday 4 January 2023

FreeBSD find files commands

Recursively find files in folder

find .//. ! -name . -print | grep -c //

Count of directories

find . -type d | wc -l

Count of directories (depth 1)

find . -maxdepth 1 -type d | wc -l

Count of files (depth 1)

find . -maxdepth 1 -type f | wc -l

Delete files that are called Zone.Identifier

find . -name "*:Zone.Identifier" -type f -delete

https://www.freebsd.org/cgi/man.cgi?query=find&apropos=0&sektion=1&manpath=FreeBSD+7.3-RELEASE&arch=default&format=html

No comments:

Post a Comment