Wednesday, March 14, 2012

FILE SEARCH

LOG IN TO ROOT USER:

[root-@local host]#

SEARCH FILE AND DIRECTORY INTO ROOT FILE SYSTEM FROM '/':
[root-@local host]#find / -name file1

SEARCH FILES AND DIRECTORIES BELONGING TO 'user1':
[root-@local host]#find / -user user1

SEARCH FILE WITH 'bin' EXTENSION WITHIN DIRECTORY '/home/user1':
[root-@local host]#find /home/user1 -name \*.bin

SEARCH BINARY FILES ARE NOT USED IN THE LAST 100 DAYS:
[root-@local host]#find /usr/bin -type f -atime +100

SEARCH FILES CREATED OR CHANGE WITHIN 10 DAYS:
[root-@local host]#find /usr/bin -type f -mtime -10

SEARCH FILES WITH '.rpm' EXTENSIONS AND MODIFY PERMITS:
[root-@local host]#find / -name *.rpm -exec chmod 755 '{}'\;

SEARCH FILES WITH '.rpm' EXTENSION IGNORING REMOVABLE PARTITIONS AS CDROM, PEN-DRIVE,....
[root-@local host]#find / -xdev -name \*.rpm

FIND FILES WITH THE '.ps' EXTENSIONS -FIRST RUN 'UPDATED' COMMAND:
[root-@local host]#locate \*.ps

SHOW LOCATION OF A BINARY FILE, SOURCE OR MAN:
[root-@local host]#whereis halt

SHOW FULL PATH TO A BINARY/EXECUTABLE:
[root-@local host]#which halt


1 comment:

  1. Excellent blog, i found some useful information from this blog, waiting for new updates.
    Linux System Administration


    ReplyDelete