How do I print a column in Unix?

thanhthao

New member
How do I print a column in Unix?
Answer
Printing the nth word or column in a file or line
  1. To print the fifth column, use the following command: $ awk ‘{ print $5 }’ filename.
  2. We can also print multiple columns and insert our custom string in between columns. For example, to print the permission and filename of each file in the current directory, use the following set of commands:
 

Tìm kiếm

Back
Top