Unix General Question: Download Questions PDF
Suppose i have one column with data smith
john
michale
the o/p should be smith,john, michale how we do in unix?
Answer:
Suppose they are asking for displaying just one of the
columns in a directory, make a note of that column number
as it appears when we do a ls -lrt. Then we can use awk to
just display the one columns as o/p.
If column number is n, then do this:
ls -lrt | awk '{print $n}'
columns in a directory, make a note of that column number
as it appears when we do a ls -lrt. Then we can use awk to
just display the one columns as o/p.
If column number is n, then do this:
ls -lrt | awk '{print $n}'
Download Unix General Interview Questions And Answers
PDF
Previous Question | Next Question |
What is grep|sort give example? | What will be the result if we run the command #find /tmp -mtime -2 and #find /tmp -mtime +2? |