Saturday, May 31st, 2008 10:55 PM
Print the contents of a file from a given regular expression to another
sed -n '/start/,/end/ p' file
This will print the contents of the ‘file’ from the line that matches /start/ until the line that matches /end/
No Comments »
Tuesday, April 22nd, 2008 10:56 PM
View from 1th to 5th line
sed -n '1,5p;5q' example.txt
No Comments »
Friday, April 18th, 2008 11:28 PM
Remove empty characters at the end of each row
sed -e 's/ *$//' file.txt
No Comments »
Wednesday, April 16th, 2008 11:17 PM
Use this command if you want to know your command usage stats in the fish shell.
grep -v "^\#" ".config/fish/fish_history"|awk '{print $1}'|sort|uniq -c|sort -rn|head -n10
No Comments »
Sunday, April 6th, 2008 11:32 PM
View only lines that contain the word “string”
sed -n '/string/p'
No Comments »
Tuesday, February 12th, 2008 11:27 PM
Remove comments and blank lines from example.pl
sed '/ *#/d; /^$/d' example.pl
No Comments »
Friday, February 8th, 2008 11:15 PM
This command shows a graphical representation of the current sub-directories.
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'mand
Original Article
No Comments »
Thursday, February 7th, 2008 11:29 PM
Remove empty lines from a file using sed
sed '/^$/d' file.txt
Original Article
No Comments »
Sunday, December 30th, 2007 10:44 PM
Get the external IP of your system - useful if you have a dynamic ip…
curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
No Comments »
Wednesday, December 26th, 2007 10:05 PM
Add a \n after every line in a file using the sed command…
sed G
No Comments »