Tag: sed

Get External IP

Get the external IP of your system – useful if you have a dynamic ip… curl -s checkip.dyndns.org|sed -e ‘s/.*Current…

Double Space a File using Sed

Add a \n after every line in a file using the sed command… sed G

Pid Command

Create a command that will return the pid of the given command string.. #!/bin/sh ps aux|grep 1|head -n1|awk ‘{print2}’

Simple Sed Command

Change all occurrences of ‘one’ to ‘two’ in the file.txt file in the grep example, enter this: sed ‘s/one/two/g’ file.txt

Fetch columns of Output using Awk

One can use awk to get a specific column from a command output… First column of the command date|awk ‘{print…