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 search for vowels a,e,i,o,u appearing in the same sequence in a file
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); }
defination of mapfile in winrunner?
Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.
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
What is the first line in a shell script?
How would you compare the strings in a shell script?
what does "kill -9" and "kill -1" do
Which is best institute for testing tool?
Why is used in shell scripting?
What are scripts in psychology?
Determine the output of the following command: [ -z “” ] && echo 0 || echo 1