linux - List files of folder page by page with LS command

06
2014-04
  • Reza Ameri

    I'm wonder if there is some way to list all files of a folder by ls, I know how to use ls for a folders which are small but if list of files doesn't match with the screen size what should I do? there is no scroll!

  • Answers
  • Jobbo

    pipe it into more:

    ls -la | more
    

    Then down arrow scrolls to the next line, spacebar jumps a page at a time


  • Related Question

    linux - How to display only Permissions and file names using ls command?
  • Questioner

    How can I display only Permissions and file names using ls command and how to list all files in a directory including full path, owner, group and permissions for each file?


  • Related Answers
  • user31894

    you can use GNU find command instead of ls unless you are doing homework

    find /path -printf "%f:%p:%u:%g" 
    

    check the man page of find more the meaning of those specifiers.

  • Octavian Damiean

    You should actually do it that way

    find /path -printf "%f:%p:%u:%g:%m\n"
    

    That way you get also the permissions and each file gets listed on one line.

  • Alan Haggai Alavi
    ls | xargs stat --printf "$(pwd)/%n %U %G %A \n"