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.
Answer Posted / 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 |
Post New Answer View All Answers
How do you debug a script?
What are the various stages of a linux process it passes through?
What is shell geeksforgeeks?
wats the deinitions for shell utility and filter?
How will you copy a file from one machine to other?
Is bash a shell script?
What are the disadvantages of shell scripting?
Determine the output of the following command: name=shubham && echo ‘my name is $name’.
What is a shell? · Types of shell · what is shell scripting?
What does it mean by #!/Bin/sh or #!/Bin/bash at the beginning of every script?
write a shell script to check the failed jobs?
What's the difference between scripting and coding?
What language is bash written in?
What is bourne shell scripting?
What are types of shells?