Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

State the advantages of shell scripting?

1053


‎What is a shell? · ‎Types of shell · ‎what is shell scripting?

984


When should shell programming/scripting not be used?

1159


Explain about debugging?

1035


Is shell scripting useful?

1061


What language is bash?

929


What is the crontab?

1097


How can I set the default rwx permission to all users on every file which is created in the current shell?

1429


Explain about echo command?

1105


What does .sh file contain?

967


What is the use of a shebang line?

1200


How can the contents of a file inside jar be read without extracting in a shell script?

1127


What is the difference between break and continue commands?

1105


What is scripting used for?

1049


Is shell scripting easy to learn?

1028