-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfind.sh
More file actions
executable file
·46 lines (27 loc) · 1.18 KB
/
find.sh
File metadata and controls
executable file
·46 lines (27 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
#get all file end with .sh
find -name "*.sh"
echo "****************************************************************************************"
#go to parent
cd ..
pwd
#type must file
find -type f -name "py*"
#type must be directory
echo "****************************************************************************************"
find -type d -name "py*"
echo "****************************************************************************************"
#filter with using permission
find -type f -perm 0777 -print
echo "****************************************************************************************"
#filter without using permission
find -type f ! -perm u+x | head -n 5
echo "*********************************time*******************************************************"
#filter with time of modification m =days
find -type d -mtime 10
echo "*********************************************"
#filter by start and end time
find -type d -mtime +10 -mtime -20 |head -n 10
echo "*********************************************"
#filter by size and print number of line note : here exec will run c program and {} replaced by current file name
find -size +3M -exec wc -l {} \;