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 |
I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?
Which is better perl or shell scripting?
Is shell scripting a programming language?
What is option in shell script?
What is eval in shell script?
What are the four fundamental components of every file system on linux?
What is .sh file in mac?
In shell scripting if text is surrounded by single quotes what does it denotes?
What can scripts do?
What is "test"? How it is used in shell scripting?
What are types of shells?
Give some situations where typing error can destroy a program?