Linux Find , Search Files with Different Criteria

1
14

[user1@localhost ~]$
[user1@localhost ~]$ mkdir find
[user1@localhost ~]$ cd find/
[user1@localhost find]$ ls -l >file1
Create a file with output redirection
[user1@localhost find]$ ls -l >listoffiles
Create another file with output redirection
[user1@localhost find]$ who >who
Create another file with output redirection


[user1@localhost find]$ ls
file1 listoffiles who

Fine with name
[user1@localhost find]$ find -name f*
./file1

Find on a Different Directory
[user1@localhost find]$ find /etc -name http*
/etc/httpd/conf/httpd.conf
find: `/etc/dhcp’: Permission denied
find: `/etc/audisp’: Permission denied
find: `/etc/racoon/scripts’: Permission denied
find: `/etc/racoon/certs’: Permission denied
find: `/etc/ntp/crypto’: Permission denied
find: `/etc/BackupPC’: Permission denied
find: `/etc/cups/ssl’: Permission denied
[user1@localhost find]$

[user1@localhost find]$ chmod 666 who
Find With Permissions
[user1@localhost find]$ find -perm 666
./who

[user1@localhost find]$ ls -l
total 12
-rw-rw-r–. 1 root user1 59 2009-12-03 11:20 file1
-rw-rw-r–. 1 user1 user1 118 2009-12-03 11:20 listoffiles
-rw-rw-rw-. 1 user1 user1 90 2009-12-03 11:21 who
Find with User and Groups
[user1@localhost find]$ find -user root
./file1
[user1@localhost find]$ find -user root -not -group root
./file1
[user1@localhost find]$ find -user root -or -group root
./file1
[user1@localhost find]$ find -user root -or -group user1
.
./who
./file1
./listoffiles
[user1@localhost find]$

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here