Find
Find
cmd: find
find command is use to search files with conditions in directory hierarchy. It is useful in finding
files with complex requirement. Such as filename, file size, file permission, file type, owner of
file uid, gid etc..
search files and executr command on this files such as chmod, grep, mv, cp, rm etc..
Find command requires a specific location, without location we cannot find file or directory.
syntax:
# find <source> <option> <expression> <action>
options:
-name name of file/directory
-user owner of file/dir
-perm permission of file/dir
-uid uid of file/dir
-gid gid of file/dir
-iname search files by name in case insensitive
-group group owner of file/dir
-type type of files
f for normal file
d directory
c character device file
p pipe file
l link file
s socket file
b block device file
-size size of file
+100M more than 100M file
100M exact 100M file
-100M less than 100M file
-perm
/u=s suid applied files
/g=s sgid applied files
/o=t sticky bit applied files
-empty search empty files and directories
-delete to delete searched file
# options:
141 ls /
142 passwd
143 ls /etc/
146 ############################################
149 #################################
162 ###############################################
167 ####################################
169 ls -l /proc/58/net/bnep
170 ~
171 ls -l /proc/58/net/bnep
172 ####################################
175 ######################
177* ls -l /dev/sd
178 ###################################
180 ls -l /dev/tty0
181 ####################################
183
184 ls -l /lib64
185 ##########################################
188 ###############################
191 ################################
193 id akshay
195 ##################################
199 ###################################
207 # ######################################
220 #################################
225 ###########################
227 #######################################
228 ls /redhat/
229 ll /redhat/
236 ######################################
241 #########################################
245 ls /redhat/
246 #####################################
256 #################################
265 history
[root@server ~]#
[root@server ~]#
[root@server ~]#
[root@server ~]#