File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
# AUTHOR : Arnob kumar saha
4
4
# Date created : 26-01-2022
5
- # Lase modified : 26-01-2022
5
+ # Lase modified : 05-09-2023
6
6
7
7
# DESCRIPTION : This script will show some stuffs that can be done using find.
8
8
# USAGE : ./find.bash
@@ -15,7 +15,7 @@ find ./demo # find everything (multilevel) in demo directory
15
15
-type f # only files
16
16
17
17
-name < a-name> # wildcard supported
18
- -iname < a-name> # case insensitive use of '-name'
18
+ -iname < a-name> # case insensitive use of '-name'
19
19
20
20
# m for modified, min for minute
21
21
-mmin -10 # those are modified less than 10 minutes ago
@@ -30,4 +30,12 @@ find ./demo # find everything (multilevel) in demo directory
30
30
31
31
find demo -exec chown arnob:some-group {} + # executing `chown arnob:some-group <file-name>` commnad
32
32
# {} is just a placeholder for file-name, And + is the sign to end the exec command.
33
- # \; could be used instead of + and any sign could be used as placeholder
33
+ # \; could be used instead of + and any sign could be used as placeholder
34
+
35
+ find . -path * /store/* # Find the paths that match */store/*
36
+ find . -iname * .sh -o -name * .bash # all shell or bash files
37
+ find . ! -name p* .bash # not operator
38
+
39
+ # to find the readme files with path */doc/*, or license files with arbitrary paths
40
+ find / \( -path * /doc/* -name README \) -o -name LICENSE # backslashes to escape
41
+
You can’t perform that action at this time.
0 commit comments