- awk 'FNR>=57,$0="allow "$0{print}' /etc/nginx/akamai_https.conf > test2.txt
- sed -i -e 's/^/text\ to \ insert/g' filename
- sed -e 's/\.[0-9]\+;/\.0\/24;/g' /tmp/ips.txt > /tmp/new_ips.txt
Here is content in file:
access_log /var/log/test.log;
I want to insert before the ; character
- sed -i -e "s/\(access_log.*.log\)\(;\)/\1\ combined\ if\=\$loggable\2/g" filename.txt
- ls -1 <dir> | xargs -n1 -i%f sed -i -e 's/old_string/new_string/g' '%f'
- vari1=/Users/huytn/test
- sed -i -e "s/old_string/${vari1//\//\\/}/g" /path/to/file