manipulating strings

1. cut

Ex. #echo “192.168.1.10:8080″| cut -d: -f1
192.168.1.10

Ex. User with uniq & sort

Ex. #netstat -nap|less|grep ‘192.168’| awk ‘{print $5}’|uniq -c|sort -nr -k 1

2. sed

match a string and replace it

echo “I love poem”|sed ‘s/peom/music/’

Leave a Reply

Your email address will not be published.