Documentos de Académico
Documentos de Profesional
Documentos de Cultura
com
Originally published on
LinuxTechLab.com
Hello Linux-fanatics in this post we will discuss find command. It is very useful utility
which we can be use to easily locate files & directories with a number of search criteria
to refine your search. Its usually installed by default on most of the Linux distributions.
will show all the files in /etc folder with size of 1 Megabytes.
command will show all the files in /testing folder with extension .txt & will also ignore if
the results are case sensitive I.e. it will show results with test1.txt or test2.TXT.
Also, if we want to find files with exact match that we can use -name instead of -iname.
4- Invertive search
$ find /testing -not -name *.txt
above command will list all the files & directories that does not have extension .txt at
the end.
Above example shows combining of two search criteria i.e.it will find all the file with
name test at the start in /testing folder which does not have extension .php.
! here is equivalent of AND operator.
Also, we can combine two search criteria & produce result when any of the two search
criteria are satisfied.
$ find /testing -name test* -o -name *.txt
it will find all the files that are created by user dan. Similarly we can also search for files
or folders that are owned by a group by replacing -user with with -group.
So this concludes my post on find command, you can read my other posts about Linux
commands HERE Please leave comments/queries in comment box below.
If you think we have helped you or just want to support us, please consider these :-
Connect to us: Facebook | Twitter | Google Plus
LinuxTechLab.com