String manipulation Flashcards
1
Q
List line numbers
A
nl /etc/autofs.conf
2
Q
scroll 6 line numbers from 13th line of a file
A
tail -n+13 /etc/autofs.conf | head -n 6
3
Q
Find particular type
A
find / -type f -name apache
4
Q
Replace string globally
A
sed s/mysql/MySQL/g /etc/snort/snort.conf > snort2.conf
5
Q
Replace once
A
sed s/mysql/MySQL/ snort.conf > snort2.conf
6
Q
Replace only first 2 occurrence
A
sed s/mysql/MySQL/2 snort.conf > snort2.conf