
Important Linux features 209
DONE
INDEX
INDEX
• set the owner and group of the directory tree dira to usera and grpa
chown usera.grpa dira
-rwxr-xr-x usera grpa 102 Apr 10 12.20 dira
13.1.6 grep
grep: search for a string in a text file and show the lines containing this string
• search for string stringa in the file fila
grep stringa fila
• search for stringa in all files in the current directory
grep stringa *
• search for stringa in all files AND directories in the current directory
grep -r stringa *
• search for stringa in all files which starts with a, b,c or d
grep stringa [a-d] *
• print the lines in fila not containing stringa
grep -v stringa fila
• ignore upper/lower case in stringa
grep -i stringa fila
• search for stringa or stringb in the file filea
grep -i "stringa|stringa" fila
Komentarze do niniejszej Instrukcji