Search Files in Linux (console based)

0
26

It is the mose recurring task in any Operating system , to locate files

as far linux is more over Console based rather a GUI here i am describing cosole based search.

mainly two type of search commands are there

  1. locate
  2. find
former one is based on a prepared database of files with in the system which have to be updated periodically for accureate results

before using locate for the first time you must use updatedb for initialize the search DB

now syntax

locate passwd

FIND

unlike locate find is making a real time search from the File structure, and so forth accuracy is high and speed is bit low

for seaching with name

find /etc -name samba

for search based on permission

find /etc/ -perm 755

Search for a file . 10MB

find /etc/ -size  +10M

search for a file less than 10M

find /etc -size -10M

search for a file excactly as 10.5 MB

find /etc -size 10.5M


LEAVE A REPLY

Please enter your comment!
Please enter your name here