Thursday, February 23, 2012

print all columns except last one

in awk:

print all columns except the first one column:
awk '{$1=""; print $0}' file

print all columns except the last one column:
awk '{$NF=""; print $0}' file

or acting as a geek, you can use the "rev" command to reverse the lines, then cut from the second field, then rev again:

rev file | cut -f2- | rev

Motivated from:

The unix command 'column' seems working for this purpose, but I did not figure it out yet. Here is column document:


  1. Hello,
    It's time to work with new project and make more clients. Make photography business more effective by taking our editing service. In fact, if you are really serious about your financial success, you can deal with Clipping Path Adept. We will give you the best editing service within your budget and it's on time.

  2. This blog is really helpful regarding all educational knowledge I earned. It covered a great area of subject which can assist a lot of needy people. Everything mentioned here is clear and very useful.

  3. Fantastic post, very informative. I wonder why the other specialists of this sector do not notice this. You must continue your writing. I'm confident, you have a great readers' base already!