Search code examples
terminalls

running "ls -lthr" in terminal


Basic question, in terminal, what does the below do?

ls -lthr

what's the difference between the above and the normal

ls -l

Thanks


Solution

  • You've got to understand that each letter after the - is an option.

    You can see those options using ls --help or man : https://man7.org/linux/man-pages/man1/ls.1.html

      -l
        use a long listing format
    
      -t     
        sort by time, newest first; see --time
    
      -h, --human-readable
        with -l and -s, print sizes like 1K 234M 2G etc.
    
      -r, --reverse
        reverse order while sorting