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 |
What is use of "cut" command?
Suppose you execute a command using exec, what will be the status of your current process in the shell?
What are the different types of variables used in shell script?
Is shell scripting easy to learn?
What is a shell made of?
Write down the syntax for all the loops in shell scripting.
What is bash used for?
wats the deinitions for shell utility and filter?
Write a shell script to check whether a number is Armstrong number or not?
How will I insert a line "abcdef" at every 100th line of a file?
what is tickets $ what low,medium,high priorite pls define time also
What is console line?