Friday, August 5, 2011
5:42 AM

Finding Files & Folders


Find

Syntax

# find location  -name  filename

Example

find /etc -name ifcfg-eth0
Find file named ifcfg-eth0 under the directory /etc.

find /home -user joe
Find every file under the directory /home owned by the user joe.

find /usr -name *stat
Find every file under the directory /usr ending in "stat".

find . -perm 664
Search for files with permission 644 in current directory

find / -inum  1011
Searches for file with inode number 1011 in entire filesystem.


Locate
Locate has comparatively easy syntax, but it is recommended to run updatedb prior to running locate.

# updated
# locate filename
Example –
# locate passwd

0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.