
210 Important Linux features
DONE
INDEX
INDEX
• search for stringa in the output of a command, e.g. ps -ef
ps -efw| grep stringa
13.1.7 find
find: search for files and directories in a directory tree
• search for entries (files and directories) called fila in the directory tree dira
find dira -name fila -print
• search for fila on all local partitions, not on NFS mounted partitions
find / -local -name fila -print
• search for entries that start with a
find dira -name "a*" -print
• search for entries not
called fila
find dira ! -name fila -print
• search for entries newer than the file fila
find dira -newer fila -print
• search for files bigger than 1000 blocks
find dira -size +1000 -print
• run a Linux command (e.g. rm, lp) on all entries fila
find dira -name fila -exec lp {} \;
for example to delete 2D processed data: 2rr, 2ri, 2ir and 2ii in /opt/topspin:
find /opt/topspin -name "2[ir][ri]" -exec rm {} \;
Komentarze do niniejszej Instrukcji