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 |
how to read systems current date and time
1.Write a script, which converts a number from binary to hexadecimal format or vice versa.
What is wc in shell script?
What are the default permissions of a file when it is created?
Is SSO and SSL support BOXI?
What is echo in shell?
How u convert string "hi pravin how are you?" to "Hi Pravin How Are You?"
Write a script to print the first 10 elements of fibonacci series.
Dear All, Can anybody tell me how to predefind no. of selected rows from a text file.
What are the advantages of using shell scripts?
What are the disadvantages of shell scripting?
Script S1 (which copies .dat files from one directory1 to another directory2) run continuously. Write Script S2 which kills S1 first, compresses all .dat files in directory1 and directory2 successfully, re-run Script S1 and stops self i.e. S2.