-
Notifications
You must be signed in to change notification settings - Fork 0
/
Comandos_de_la_terminal%2Ffind.mw
313 lines (270 loc) · 10 KB
/
Comandos_de_la_terminal%2Ffind.mw
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
__NOTOC__
* [[:#find| find]]
== find ==
<syntaxhighlight lang="bash">
[rrc@Pridd ~]$ find --help
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
default path is the current directory; default expression is -print
expression may consist of: operators, options, tests, and actions:
operators (decreasing precedence; -and is implicit where no others are given):
( EXPR ) ! EXPR -not EXPR EXPR1 -a EXPR2 EXPR1 -and EXPR2
EXPR1 -o EXPR2 EXPR1 -or EXPR2 EXPR1 , EXPR2
positional options (always true): -daystart -follow -regextype
normal options (always true, specified before other expressions):
-depth --help -maxdepth LEVELS -mindepth LEVELS -mount -noleaf
--version -xdev -ignore_readdir_race -noignore_readdir_race
tests (N can be +N or -N or N): -amin N -anewer FILE -atime N -cmin N
-cnewer FILE -ctime N -empty -false -fstype TYPE -gid N -group NAME
-ilname PATTERN -iname PATTERN -inum N -iwholename PATTERN -iregex PATTERN
-links N -lname PATTERN -mmin N -mtime N -name PATTERN -newer FILE
-nouser -nogroup -path PATTERN -perm [-/]MODE -regex PATTERN
-readable -writable -executable
-wholename PATTERN -size N[bcwkMG] -true -type [bcdpflsD] -uid N
-used N -user NAME -xtype [bcdpfls]
-context CONTEXT
actions: -delete -print0 -printf FORMAT -fprintf FILE FORMAT -print
-fprint0 FILE -fprint FILE -ls -fls FILE -prune -quit
-exec COMMAND ; -exec COMMAND {} + -ok COMMAND ;
-execdir COMMAND ; -execdir COMMAND {} + -okdir COMMAND ;
Report (and track progress on fixing) bugs via the findutils bug-reporting
page at http://savannah.gnu.org/ or, if you have no web access, by sending
email to <[email protected]>.
[rrc@Pridd ~]$ find --version
find (GNU findutils) 4.5.12
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Eric B. Decker, James Youngman, and Kevin Dalley.
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS(FTS_CWDFD) CBO(level=2)
[rrc@Pridd ~]$ man find
[rrc@Pridd ~]$ find /var/www -name index.php
/var/www/garcon.linuxcabal.org/index.php
/var/www/prestamosabastos.mx/index.php
/var/www/calidadcasera.mx/index.php
/var/www/wnsoluciones.mx/index.php
/var/www/www.mxrep.mx/index.php
/var/www/almastock.asambiental.mx/index.php
/var/www/mediawiki/index.php
/var/www/mediawiki/mw-config/index.php
/var/www/mediawiki/config/index.php
/var/www/defaultNuevaWWW/index.php
/var/www/html/admin/php5coder/index.php
/var/www/html/linuxcabal.com/index.php
/var/www/html/linuxcabal.com/4toCongresoSoftwareLibreUNAM/index.php
/var/www/html/linuxcabal.org/index.phprm
/var/www/html/linuxcabal.org/ArduinoCabal/index.php
/var/www/html/linuxcabal.org/PHPCabal/index.php
/var/www/html/linuxcabal.org/PHPDev/htdocs/index.php
/var/www/html/linuxcabal.org/PythonCabal/index.php
/var/www/html/linuxcabal.org/4toCongresoSoftwareLibreUNAM/index.php
[rrc@Llawyr ~]$ find . -name ComandosDeLaTerminal
./ComandosDeLaTerminal
[rrc@Llawyr ~]$ find . -iname ComandosDeLaTerminal
./ComandosDeLaTerminal
./ComandosDeLaTerminal/comandosDeLaterMINal
[rrc@Llawyr ~]$ find /var/www/html -type d -name images
/var/www/html/nova/carrera20041023/images
/var/www/html/nova/images
/var/www/html/iovatious/images
/var/www/html/coffeenet/images
/var/www/html/images
/var/www/html/richard/images
/var/www/html/MexHoliday/images
/var/www/html/PaulTaylor/images
/var/www/html/linuxcabal.org/Microsoft20080925Images/images
/var/www/html/linuxcabal.org/Aniversario2006Images/images
/var/www/html/linuxcabal.org/AsociacionCivilImages/images
/var/www/html/linuxcabal.org/10thRTLW20081025Images/images
/var/www/html/linuxcabal.org/RMS20050926Images/images
.
.
./var/www/html/linuxcabal.com/EnSuDerecho20130703Images/images
/var/www/html/linuxcabal.com/ITSdeTantoyuca20060620Images/images
/var/www/html/linuxcabal.com/HospRegLaBarca20081114Images/images
/var/www/html/linuxcabal.com/FLISoL20070428Images/images
[rrc@Llawyr ~]$ find ComandosDeLaTerminal -type f -name "Cat*"
ComandosDeLaTerminal/CatArchivo
ComandosDeLaTerminal/CatArchivo2
ComandosDeLaTerminal/CatArchivo3
[rrc@Llawyr ~]$ find . -type f -perm 0777 -print
./ComandosDeLaTerminal/WCEjemplo
[rrc@Llawyr ~]$ find . -type f -perm 777 -print
./ComandosDeLaTerminal/WCEjemplo
[rrc@Llawyr ~]$ ls -al ComandosDeLaTerminal/WCEjemplo
-rwxrwxrwx 1 rrc rrc 45 Jan 2 2014 ComandosDeLaTerminal/WCEjemplo*
[rrc@Llawyr ~]$ find ComandosDeLaTerminal -type d -perm 700
ComandosDeLaTerminal
ComandosDeLaTerminal/UmaskPruebaCarpeta
ComandosDeLaTerminal/NuevaCarpeta2
ComandosDeLaTerminal/NuevaCarpeta
ComandosDeLaTerminal/Algo2013Dir
ComandosDeLaTerminal/Carpeta1/Carpeta2
[rrc@Llawyr ~]$ find ComandosDeLaTerminal -type d ! -perm 700
ComandosDeLaTerminal/Carpeta21
ComandosDeLaTerminal/Carpeta21/Carpeta22
ComandosDeLaTerminal/Carpeta21/Carpeta22/Carpeta33
ComandosDeLaTerminal/Carpeta21/Carpeta22/Carpeta23
ComandosDeLaTerminal/NuevaCarpeta4
ComandosDeLaTerminal/Carpeta11
ComandosDeLaTerminal/Carpeta11/Carpeta12
ComandosDeLaTerminal/Carpeta11/Carpeta12/Carpeta13
ComandosDeLaTerminal/Carpeta2
ComandosDeLaTerminal/NuevaCarpeta5
ComandosDeLaTerminal/NuevaCarpeta3
ComandosDeLaTerminal/UmaskPruebaCarpeta2
ComandosDeLaTerminal/NuevaCarpeta6
ComandosDeLaTerminal/Carpeta1
[rrc@Llawyr ~]$ find /bin -perm /u=s
[rrc@Llawyr ~]$ find /usr/bin -perm /u=s
/usr/bin/su
/usr/bin/crontab
/usr/bin/batch
/usr/bin/chsh
/usr/bin/pkexec
/usr/bin/gpgsm
/usr/bin/procmail
/usr/bin/newgrp
/usr/bin/cdrdao
/usr/bin/ping
/usr/bin/ping6
/usr/bin/gpasswd
/usr/bin/fusermount
/usr/bin/passwd
/usr/bin/at
/usr/bin/lppasswd
/usr/bin/Xwrapper
/usr/bin/umount
/usr/bin/chfn
/usr/bin/mount
[rrc@Llawyr ~]$ find -L /bin -perm /u=s
/bin/su
/bin/crontab
/bin/batch
/bin/X
/bin/atrm
/bin/chsh
/bin/pkexec
/bin/gpgsm
/bin/procmail
/bin/newgrp
/bin/cdrdao
/bin/sg
/bin/ping
/bin/ping6
/bin/gpasswd
/bin/fusermount
/bin/passwd
/bin/at
/bin/lppasswd
/bin/Xwrapper
/bin/atq
/bin/umount
/bin/chfn
/bin/mount
[rrc@Llawyr ~]$ find ComandosDeLaTerminal -type f -perm 0777 -print -exec chmod 644 {} \;
ComandosDeLaTerminal/WCEjemplo
[rrc@Llawyr ~]$ ls -al ComandosDeLaTerminal/WCEjemplo
-rw-r--r-- 1 rrc rrc 45 Jan 2 2014 ComandosDeLaTerminal/WCEjemplo
[rrc@Llawyr ~]$ find . -name "*~"
./.vimrc~
./Music/loadmp3.sh~
./.config/monitors.xml~
./Titles~
[rrc@Llawyr ~]$ find . -name "*~" -exec rm {} \;
[rrc@Llawyr ~]$ find . -name "*~"
[rrc@Llawyr ~]$ find ComandosDeLaTerminal/ -type f -empty
ComandosDeLaTerminal/OutTxt
ComandosDeLaTerminal/DelMe3
ComandosDeLaTerminal/LSList
ComandosDeLaTerminal/File
ComandosDeLaTerminal/Archivo3DeTres
ComandosDeLaTerminal/TouchArchivo
ComandosDeLaTerminal/FileKill
ComandosDeLaTerminal/Archivo1DeTres
ComandosDeLaTerminal/ArDeTres
ComandosDeLaTerminal/File3
ComandosDeLaTerminal/ArchivodeTres
ComandosDeLaTerminal/comandosDeLaterMINal
ComandosDeLaTerminal/UmaskPruebaArchivo2~
ComandosDeLaTerminal/UmaskPruebaArchivo
ComandosDeLaTerminal/Carpeta1/Carpeta2/Archivo
ComandosDeLaTerminal/File1
ComandosDeLaTerminal/ArD
ComandosDeLaTerminal/DelMe
ComandosDeLaTerminal/Archivo2DeTres
ComandosDeLaTerminal/File2
[rrc@Llawyr ~]$ find . ! -user rrc -exec ls -al {} \;
-rw-r--r-- 1 root root 32768 Aug 20 15:57 ./.local/share/gvfs-metadata/root-c9c9d49b.log
-rw-r--r-- 1 root root 32768 Aug 20 15:57 ./.local/share/gvfs-metadata/home-2415262f.log
brw-rw---- 1 root cdrom 11, 0 Aug 7 08:38 ./ComandosDeLaTerminal/sr0
-rw-r--r-- 1 root root 8376 Aug 9 07:53 ./Downloads/xdemineur-2.1.1/demineur.o
-rw-r--r-- 1 root root 4200 Aug 9 07:53 ./Downloads/xdemineur-2.1.1/main.o
-rw-r--r-- 1 root root 1688 Aug 9 07:53 ./Downloads/xdemineur-2.1.1/util.o
-rw-r--r-- 1 root root 29230 Aug 9 07:52 ./Downloads/xdemineur-2.1.1/Makefile
[rrc@Llawyr ~]$ find . ! -group rrc -exec ls -al {} \;
-rw-rw-r-- 1 rrc nogroup 8390 Aug 12 16:30 ./ImadineProj/jdORIG.xlsx
-rw-rw-r-- 1 rrc nogroup 144850 Aug 12 16:30 ./ImadineProj/jd.xlsx
-rw-r--r-- 1 root root 32768 Aug 20 15:57 ./.local/share/gvfs-metadata/root-c9c9d49b.log
-rw-r--r-- 1 root root 32768 Aug 20 15:57 ./.local/share/gvfs-metadata/home-2415262f.log
brw-rw---- 1 root cdrom 11, 0 Aug 7 08:38 ./ComandosDeLaTerminal/sr0
-rw-r--r-- 1 root root 8376 Aug 9 07:53 ./Downloads/xdemineur-2.1.1/demineur.o
-rw-r--r-- 1 root root 4200 Aug 9 07:53 ./Downloads/xdemineur-2.1.1/main.o
-rw-r--r-- 1 root root 1688 Aug 9 07:53 ./Downloads/xdemineur-2.1.1/util.o
-rw-r--r-- 1 root root 29230 Aug 9 07:52 ./Downloads/xdemineur-2.1.1/Makefile
[rrc@Llawyr ~]$ for i in {0..10}; do echo $i; find ComandosDeLaTerminal/ -ctime $i; done
0
ComandosDeLaTerminal/
ComandosDeLaTerminal/index.html~
ComandosDeLaTerminal/WCEjemplo
ComandosDeLaTerminal/UmaskPruebaArchivo2
ComandosDeLaTerminal/comandosDeLaterMINal
ComandosDeLaTerminal/index.html
ComandosDeLaTerminal/UmaskPruebaArchivo2~
1
2
3
4
5
6
ComandosDeLaTerminal/S27.sh
ComandosDeLaTerminal/UmaskPruebaCarpeta
ComandosDeLaTerminal/UmaskPruebaCarpeta/MiArchivo
7
8
9
10
[rrc@Llawyr ~]$ for i in {20..30}; do echo $i; find ComandosDeLaTerminal/ -cmin $i; done
20
21
22
23
24
25
ComandosDeLaTerminal/
ComandosDeLaTerminal/index.html~
ComandosDeLaTerminal/WCEjemplo
ComandosDeLaTerminal/index.html
26
ComandosDeLaTerminal/UmaskPruebaArchivo2
ComandosDeLaTerminal/UmaskPruebaArchivo2~
27
28
29
30
[rrc@Llawyr ~]$ find ComandosDeLaTerminal -cmin -120
ComandosDeLaTerminal
ComandosDeLaTerminal/index.html~
ComandosDeLaTerminal/WCEjemplo
ComandosDeLaTerminal/UmaskPruebaArchivo2
ComandosDeLaTerminal/comandosDeLaterMINal
ComandosDeLaTerminal/index.html
ComandosDeLaTerminal/UmaskPruebaArchivo2~
[rrc@Llawyr ~]$ find ComandosDeLaTerminal -size +1000
ComandosDeLaTerminal/nohup.out
[rrc@Llawyr ~]$ ls -al ComandosDeLaTerminal/nohup.out
-rw------- 1 rrc rrc 1013278 Apr 12 16:54 ComandosDeLaTerminal/nohup.out
[rrc@Llawyr ~]$ find /var/www/wnsoluciones.mx -type d -exec chmod 2775 {} \;
[rrc@Llawyr ~]$ find /var/www/wnsoluciones.mx -type f -exec chmod 664 {} \;
</syntaxhighlight>
[[Category:Comandos de la terminal]]