How to sort a result of Ls -l command based on columns. Ex.
i want to sort 5th column from output of ls -l command.
Answers were Sorted based on User's Feedback
Answer / kiran
$ ls -al | sort -n -k5
The -n in my example means "sort numerically", and the -k5
option means to key off of column five. Like other Unix
commands, these options can be combined and shortened, like
this:
$ ls -al | sort -nk5
Is This Answer Correct ? | 13 Yes | 1 No |
Answer / karunaprakash
Place the selected 5th coloumn in the file file1 and sort
the file1.
$ ls -l | cut -f 5 > file1
$sort file1
Is This Answer Correct ? | 1 Yes | 1 No |
Why should we use shell scripts?
What is the command to find out users on the system?
What does chmod do?
What is a shell script in windows?
How will you connect to a database server from linux?
What is option in shell script?
give me some website where i can get unix and testing meterials
What are the additional egrep symbols?
How important is shell scripting?
HOW TO CREATE 10 USERS IN UNIX(HP-UX) USING SHELL SHELL SCRIPT?
Create a bash shell script that reads a line from the user consisting of 5 words and then prints them out in reverse order. Name this script "reverse.sh"
Hi, i want to zip the files that generates automatically every few minutes (files generated are in .arc extension)....any body write a script for this... thanks in advance