List only regular files

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I desire to list all inodes in current directory that are regular files (i.e. not directories, links, or special files), with ls -la (ll).



I went to the man ls searching for type and found only this which I didn't quite understand in that regard:




--indicator-style=WORD



append indicator with style WORD to entry names: none (default), slash
(-p), file-type (--file-type),
classify (-F)




How could I list only regular files with ls -la (ll as my shortcut in Ubuntu 18.04)?










share|improve this question



















  • 1




    Possible duplicate of How to output only file names (with spaces) in ls -Al?
    – eyoung100
    2 hours ago






  • 1




    Possible duplicate of List only regular files (but not directories) in current directory
    – Stephen Kitt
    22 mins ago














up vote
1
down vote

favorite












I desire to list all inodes in current directory that are regular files (i.e. not directories, links, or special files), with ls -la (ll).



I went to the man ls searching for type and found only this which I didn't quite understand in that regard:




--indicator-style=WORD



append indicator with style WORD to entry names: none (default), slash
(-p), file-type (--file-type),
classify (-F)




How could I list only regular files with ls -la (ll as my shortcut in Ubuntu 18.04)?










share|improve this question



















  • 1




    Possible duplicate of How to output only file names (with spaces) in ls -Al?
    – eyoung100
    2 hours ago






  • 1




    Possible duplicate of List only regular files (but not directories) in current directory
    – Stephen Kitt
    22 mins ago












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I desire to list all inodes in current directory that are regular files (i.e. not directories, links, or special files), with ls -la (ll).



I went to the man ls searching for type and found only this which I didn't quite understand in that regard:




--indicator-style=WORD



append indicator with style WORD to entry names: none (default), slash
(-p), file-type (--file-type),
classify (-F)




How could I list only regular files with ls -la (ll as my shortcut in Ubuntu 18.04)?










share|improve this question















I desire to list all inodes in current directory that are regular files (i.e. not directories, links, or special files), with ls -la (ll).



I went to the man ls searching for type and found only this which I didn't quite understand in that regard:




--indicator-style=WORD



append indicator with style WORD to entry names: none (default), slash
(-p), file-type (--file-type),
classify (-F)




How could I list only regular files with ls -la (ll as my shortcut in Ubuntu 18.04)?







ls inode






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 22 mins ago









Stephen Kitt

154k23340409




154k23340409










asked 2 hours ago









JohnDoea

72731




72731







  • 1




    Possible duplicate of How to output only file names (with spaces) in ls -Al?
    – eyoung100
    2 hours ago






  • 1




    Possible duplicate of List only regular files (but not directories) in current directory
    – Stephen Kitt
    22 mins ago












  • 1




    Possible duplicate of How to output only file names (with spaces) in ls -Al?
    – eyoung100
    2 hours ago






  • 1




    Possible duplicate of List only regular files (but not directories) in current directory
    – Stephen Kitt
    22 mins ago







1




1




Possible duplicate of How to output only file names (with spaces) in ls -Al?
– eyoung100
2 hours ago




Possible duplicate of How to output only file names (with spaces) in ls -Al?
– eyoung100
2 hours ago




1




1




Possible duplicate of List only regular files (but not directories) in current directory
– Stephen Kitt
22 mins ago




Possible duplicate of List only regular files (but not directories) in current directory
– Stephen Kitt
22 mins ago










3 Answers
3






active

oldest

votes

















up vote
5
down vote













ls doesn’t have an option to do this, and you shouldn’t parse its output to filter regular files.



find can be used to find and list regular files instead of ls. Another option is to use Zsh and its glob qualifiers:



ls -l -- *(D.)


lists all regular files, including those whose name starts with a dot.






share|improve this answer





























    up vote
    2
    down vote













    find . -maxdepth 1 -type f -ls


    This would give you the regular files in the current directory in a format similar to what you would get with ls -lisa (but only showing regular files, thanks to -type -f on the command line).






    share|improve this answer



























      up vote
      1
      down vote













      Well when you use -a is shows everything that is hidden; hidden files and folders. Instead of ls, you'll probably want to use the find command instead. This should help you get started:



      find -type f -exec ls -la ;


      You'll need to change to the directory you want to search first.






      share|improve this answer








      New contributor




      The Letter M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.













      • 1




        You probably should use -maxdepth 1 to stop the find descending into subdirectories.
        – roaima
        1 hour ago










      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "106"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480035%2flist-only-regular-files%23new-answer', 'question_page');

      );

      Post as a guest






























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      5
      down vote













      ls doesn’t have an option to do this, and you shouldn’t parse its output to filter regular files.



      find can be used to find and list regular files instead of ls. Another option is to use Zsh and its glob qualifiers:



      ls -l -- *(D.)


      lists all regular files, including those whose name starts with a dot.






      share|improve this answer


























        up vote
        5
        down vote













        ls doesn’t have an option to do this, and you shouldn’t parse its output to filter regular files.



        find can be used to find and list regular files instead of ls. Another option is to use Zsh and its glob qualifiers:



        ls -l -- *(D.)


        lists all regular files, including those whose name starts with a dot.






        share|improve this answer
























          up vote
          5
          down vote










          up vote
          5
          down vote









          ls doesn’t have an option to do this, and you shouldn’t parse its output to filter regular files.



          find can be used to find and list regular files instead of ls. Another option is to use Zsh and its glob qualifiers:



          ls -l -- *(D.)


          lists all regular files, including those whose name starts with a dot.






          share|improve this answer














          ls doesn’t have an option to do this, and you shouldn’t parse its output to filter regular files.



          find can be used to find and list regular files instead of ls. Another option is to use Zsh and its glob qualifiers:



          ls -l -- *(D.)


          lists all regular files, including those whose name starts with a dot.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 7 mins ago









          Stéphane Chazelas

          291k54543882




          291k54543882










          answered 2 hours ago









          Stephen Kitt

          154k23340409




          154k23340409






















              up vote
              2
              down vote













              find . -maxdepth 1 -type f -ls


              This would give you the regular files in the current directory in a format similar to what you would get with ls -lisa (but only showing regular files, thanks to -type -f on the command line).






              share|improve this answer
























                up vote
                2
                down vote













                find . -maxdepth 1 -type f -ls


                This would give you the regular files in the current directory in a format similar to what you would get with ls -lisa (but only showing regular files, thanks to -type -f on the command line).






                share|improve this answer






















                  up vote
                  2
                  down vote










                  up vote
                  2
                  down vote









                  find . -maxdepth 1 -type f -ls


                  This would give you the regular files in the current directory in a format similar to what you would get with ls -lisa (but only showing regular files, thanks to -type -f on the command line).






                  share|improve this answer












                  find . -maxdepth 1 -type f -ls


                  This would give you the regular files in the current directory in a format similar to what you would get with ls -lisa (but only showing regular files, thanks to -type -f on the command line).







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 2 hours ago









                  Kusalananda

                  113k15217345




                  113k15217345




















                      up vote
                      1
                      down vote













                      Well when you use -a is shows everything that is hidden; hidden files and folders. Instead of ls, you'll probably want to use the find command instead. This should help you get started:



                      find -type f -exec ls -la ;


                      You'll need to change to the directory you want to search first.






                      share|improve this answer








                      New contributor




                      The Letter M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.













                      • 1




                        You probably should use -maxdepth 1 to stop the find descending into subdirectories.
                        – roaima
                        1 hour ago














                      up vote
                      1
                      down vote













                      Well when you use -a is shows everything that is hidden; hidden files and folders. Instead of ls, you'll probably want to use the find command instead. This should help you get started:



                      find -type f -exec ls -la ;


                      You'll need to change to the directory you want to search first.






                      share|improve this answer








                      New contributor




                      The Letter M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.













                      • 1




                        You probably should use -maxdepth 1 to stop the find descending into subdirectories.
                        – roaima
                        1 hour ago












                      up vote
                      1
                      down vote










                      up vote
                      1
                      down vote









                      Well when you use -a is shows everything that is hidden; hidden files and folders. Instead of ls, you'll probably want to use the find command instead. This should help you get started:



                      find -type f -exec ls -la ;


                      You'll need to change to the directory you want to search first.






                      share|improve this answer








                      New contributor




                      The Letter M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      Well when you use -a is shows everything that is hidden; hidden files and folders. Instead of ls, you'll probably want to use the find command instead. This should help you get started:



                      find -type f -exec ls -la ;


                      You'll need to change to the directory you want to search first.







                      share|improve this answer








                      New contributor




                      The Letter M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      share|improve this answer



                      share|improve this answer






                      New contributor




                      The Letter M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      answered 2 hours ago









                      The Letter M

                      313




                      313




                      New contributor




                      The Letter M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.





                      New contributor





                      The Letter M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.






                      The Letter M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.







                      • 1




                        You probably should use -maxdepth 1 to stop the find descending into subdirectories.
                        – roaima
                        1 hour ago












                      • 1




                        You probably should use -maxdepth 1 to stop the find descending into subdirectories.
                        – roaima
                        1 hour ago







                      1




                      1




                      You probably should use -maxdepth 1 to stop the find descending into subdirectories.
                      – roaima
                      1 hour ago




                      You probably should use -maxdepth 1 to stop the find descending into subdirectories.
                      – roaima
                      1 hour ago

















                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480035%2flist-only-regular-files%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Comments

                      Popular posts from this blog

                      What does second last employer means? [closed]

                      List of Gilmore Girls characters

                      One-line joke