2 Questions:

1) How should I long list a directory. Kindly guide me if there's are multiple options to do this .? 2) How do I sort based on the file size?

  • Is this a homework assignment? Have you read the manual pages (man ls)? Dec 18, 2014 at 18:29

1 Answer 1


1) You can use | more and scroll with space or down arrow. like this: /# ls /etc/ | more

2) For sorting by file size use ls -lS or ls -lSh for print sizes in KB MB or GB. If you wanna invert the result, use -r switch. ls -lShr For more arguments ls --help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.