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.

Answers were Sorted based on User's Feedback



How to sort a result of Ls -l command based on columns. Ex. i want to sort 5th column from output ..

Answer / xxx

ls -l|sort -nk5

Is This Answer Correct ?    21 Yes 2 No

How to sort a result of Ls -l command based on columns. Ex. i want to sort 5th column from output ..

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

How to sort a result of Ls -l command based on columns. Ex. i want to sort 5th column from output ..

Answer / amrapalee jawalikar

ls -l | sort +4 -5

Is This Answer Correct ?    2 Yes 1 No

How to sort a result of Ls -l command based on columns. Ex. i want to sort 5th column from output ..

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 sort a result of Ls -l command based on columns. Ex. i want to sort 5th column from output ..

Answer / vikas

ls -al | sort | cut -d ' ' -f 5

Is This Answer Correct ?    2 Yes 9 No

How to sort a result of Ls -l command based on columns. Ex. i want to sort 5th column from output ..

Answer / rajesh

ls -l | awk '{print $5}'

Is This Answer Correct ?    7 Yes 16 No

Post New Answer

More Shell Script Interview Questions

how to search for vowels a,e,i,o,u appearing in the same sequence in a file

4 Answers   Amazon,


How to replace following lines, catch (DAOException e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw new BOException(5122); } catch (BOException e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw e; } catch (Exception e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw new BOException(5122); } Needs to be changed in to, catch (DAOException e) { AppException.handleException (null, null, e, null, null, null, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 5122); } catch (BOException e) { AppException.handleException (null, null, null, e, null, null, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 0); } catch (Exception e) { AppException.handleException (null, null, null, null, null, e, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 5122); }

0 Answers   Wipro,


defination of mapfile in winrunner?

0 Answers  


Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.

0 Answers  


how do you write sql queries using shell script for eg:- we have databae table like EMPNO,ENAME,SAL,DEPTNO columns in EMP table how you display EMPNO,SAL FIELDS from emp in SHELL SCRIPT please explain with an example

4 Answers  


What is the first line in a shell script?

0 Answers  


How would you compare the strings in a shell script?

0 Answers  


what does "kill -9" and "kill -1" do

2 Answers   Amazon,


Which is best institute for testing tool?

0 Answers  


Why is used in shell scripting?

0 Answers  


What are scripts in psychology?

0 Answers  


Determine the output of the following command: [ -z “” ] && echo 0 || echo 1

0 Answers  


Categories