unixcl.com
UNIX Command Line: December 2014
http://www.unixcl.com/2014_12_01_archive.html
Where there is a shell, there is a WAY! Blog on Awk, Sed, BASH ones liners and scripts. Saturday, December 20, 2014. Unix - Delete blank lines from file. Here's some ways to remove empty or blank lines from a file in Unix. Simple but definitely useful. Grep -v ' $' file.txt $. Grep '.' file.txt $. Sed '/ $/d' file.txt $. Sed -n '/ $/! P' file.txt $. Awk NF file.txt $. Awk '/./' file.txt. In Vi editor, in escape mode type. Unix - Remove duplicate blank lines from file using Awk. Posted by Jadu Saikia.
unixcl.com
UNIX Command Line: Happy new year 2015 to all unix lovers
http://www.unixcl.com/2015/01/happy-new-year-2015-to-all-unix-lovers.html
Where there is a shell, there is a WAY! Blog on Awk, Sed, BASH ones liners and scripts. Thursday, January 1, 2015. Happy new year 2015 to all unix lovers. Wishing all the readers of unixcl.com a Happy and Healthy 2015 ahead, keep rocking! Posted by Jadu Saikia. Labels: bash shell newbie. Subscribe to: Post Comments (Atom). 169; Jadu Saikia. Search on UNIXCL.com. View my complete profile. Another blog of mine. Bash command line argument. Matrix operations using awk.
unixcl.com
UNIX Command Line: October 2012
http://www.unixcl.com/2012_10_01_archive.html
Where there is a shell, there is a WAY! Blog on Awk, Sed, BASH ones liners and scripts. Tuesday, October 30, 2012. Time bucketing using Awk in Unix. Each line of input file file.txt is having UNIX epoch timestamp and some value. Cat file.txt Epoch,Value 1351605000,120 1351605060,130 1351605120,340 1351605180,200 1351605240,120 1351605300,890 1351605360,124 1351605420,450 1351605480,120 1351605540,120 1351605600,200 1351605660,120 1351605720,340 1351605780,670 1351605840,990. Awk 'BEGIN {FS=OFS=","} NR!
unixcl.com
UNIX Command Line: Unix - run multiple commands on remote machines in parallel
http://www.unixcl.com/2015/03/unix-run-multiple-commands-on-remote.html
Where there is a shell, there is a WAY! Blog on Awk, Sed, BASH ones liners and scripts. Saturday, March 7, 2015. Unix - run multiple commands on remote machines in parallel. Assume you have a requirement of running two commands on 10 hosts. In this post I would like to show you how you can:. 1) Run multiple commands on remote host using ssh. 2) Also instead of working on one host at a time serially, how can we execute the commands on multiple hosts in parallel to save the overall execution time. 1921966&...
unixcl.com
UNIX Command Line: Unix - Delete blank lines from file
http://www.unixcl.com/2014/12/unix-delete-blank-lines-from-file.html
Where there is a shell, there is a WAY! Blog on Awk, Sed, BASH ones liners and scripts. Saturday, December 20, 2014. Unix - Delete blank lines from file. Here's some ways to remove empty or blank lines from a file in Unix. Simple but definitely useful. Grep -v ' $' file.txt $. Grep '.' file.txt $. Sed '/ $/d' file.txt $. Sed -n '/ $/! P' file.txt $. Awk NF file.txt $. Awk '/./' file.txt. In Vi editor, in escape mode type. Unix - Remove duplicate blank lines from file using Awk. Posted by Jadu Saikia.
unixcl.com
UNIX Command Line: May 2013
http://www.unixcl.com/2013_05_01_archive.html
Where there is a shell, there is a WAY! Blog on Awk, Sed, BASH ones liners and scripts. Wednesday, May 8, 2013. Unix - Append 0 to single digit date. Input file file.txt has dates in month/day/year format. Cat file.txt 3/4/2013 3/10/2013 10/4/2013 12/10/2012. Required: Add prefix 0 to first and second field if its a single digit. Awk 'BEGIN {FS=OFS="/"} { if (length($1) = 1) $1="0"$1 if (length($2) = 1) $2="0"$2 { print } }' file.txt. 03/04/2013 03/10/2013 10/04/2013 12/10/2012. Posted by Jadu Saikia.
unixcl.com
UNIX Command Line: Awk - numbering lines ignoring blank lines
http://www.unixcl.com/2009/12/awk-numbering-lines-ignoring-blank.html
Where there is a shell, there is a WAY! Blog on Awk, Sed, BASH ones liners and scripts. Sunday, December 6, 2009. Awk - numbering lines ignoring blank lines. In one of my earlier post. I have already discussed on numbering lines in a file using awk, here is a similar post to number lines ignoring 'blank lines' present. Input file 'file.txt' has got first 2 lines fixed as HEADER line, followed by a number of record lines ( k). H1 456 v1 1. H2 190 - 5. K rn 90.67 12 90. K rn 90.43 22 35. H1 456 v1 1. As yo...
unixcl.com
UNIX Command Line: January 2015
http://www.unixcl.com/2015_01_01_archive.html
Where there is a shell, there is a WAY! Blog on Awk, Sed, BASH ones liners and scripts. Thursday, January 1, 2015. Happy new year 2015 to all unix lovers. Wishing all the readers of unixcl.com a Happy and Healthy 2015 ahead, keep rocking! Posted by Jadu Saikia. Labels: bash shell newbie. Subscribe to: Posts (Atom). 169; Jadu Saikia. Search on UNIXCL.com. View my complete profile. Another blog of mine. Bash command line argument. Matrix operations using awk.
unixcl.com
UNIX Command Line: Diff remote files using ssh in Linux
http://www.unixcl.com/2009/01/diff-remote-files-using-ssh-in-linux.html
Where there is a shell, there is a WAY! Blog on Awk, Sed, BASH ones liners and scripts. Thursday, January 22, 2009. Diff remote files using ssh in Linux. I have already discussed how we can edit a remote file using vi and scp in one of my previous post. Today we will see how we can find or show differences between a local file and a remote file using ssh. This is how can do it:. Ssh root@172.21.16.11 "cat /scripts/filepurge.sh" diff - /tmp/filepurge.sh.old. Posted by Jadu Saikia. 169; Jadu Saikia.
unixcl.com
UNIX Command Line: Remove duplicate blank lines - bash & awk
http://www.unixcl.com/2008/12/remove-duplicate-blank-lines-bash-awk.html
Where there is a shell, there is a WAY! Blog on Awk, Sed, BASH ones liners and scripts. Thursday, December 25, 2008. Remove duplicate blank lines - bash and awk. First line, two blank lines above. 3 blank lines below. One more line,a blank line below. A blank line below. Let me put the line number at the beginning of each line of the above file to see the blank lines. Awk '{print NR,$0}' file.txt. 3 first line, two blank lines above. 4 3 blank lines below. 7 one more line,a blank line below.