AWK – Print All Columns from nth to Last

awkcygwinlinuxshell

This line worked until I had whitespace in the second field:

svn status | grep '\!' | gawk '{print $2;}' > removedProjs

Is there a way to have awk print everything in $2 or greater? ($3, $4.. until we don't have any more columns?)

I'm doing this in a Windows environment with Cygwin.

Best Answer

Print all columns:

awk '{print $0}' somefile

Print all but the first column:

awk '{$1=""; print $0}' somefile

Print all but the first two columns:

awk '{$1=$2=""; print $0}' somefile
Related Question