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 / 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 |
Post New Answer View All Answers
How to print the first array element?
What are types of shells?
What are the different variables present in linux shell?
What are the two files of crontab command?
Is shell script a programming language?
How will you find the 99th line of a file using only tail and head command?
What is the difference between break and continue commands?
Explain about "s" permission bit in a file?
How to use arguments in a script?
How to get the first line from a file using just the terminal?
How can the contents of a file inside jar be read without extracting in a shell script?
What is bash command used for?
What is the use of break command?
What is awk script?
Write a shell script to get current date, time, user name and current working directory.