Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting a column of text

Status
Not open for further replies.

doobop

IS-IT--Management
Oct 11, 2002
3
GB
This may seem like a dumb question, but I've got a list of files from 'ls -l' and I want to delete the colums with the date and time in. THis is so I can do a diff on this with one from another supposedly similar box. eg
-rw-r--r-- 1 oracle dba 162805 Nov 25 15:49 upgrade_8174.lst
becomes
-rw-r--r-- 1 oracle dba 162805 upgrade_8174.lst
Anybody know how I can achieve this.
Thanks for any help
Doobop
 
ls -l | nawk '{$6=$7=$8=""; print}'

NOTE: your mileage may vary vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Thanks, that worked a treat.

Chris
 
Clonny2, Found that ls -l | cut -c-41,54- does the same job. Thanks all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top