List readonly files












3














I need to list or show or query for the files in a folder (well, technically, on a USB drive, but I can navigate to it in Finder/Terminal) that are marked readonly.



All the Google-fu in the world just reveals solutions to change permissions but I don't need to do that.



My Dashcam marks videos/images readonly to save them when I press the button on it, but they're still in a folder with a few hundred MOV files, and I need a simple way to filter down to the ones I am looking for.










share|improve this question









New contributor




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

























    3














    I need to list or show or query for the files in a folder (well, technically, on a USB drive, but I can navigate to it in Finder/Terminal) that are marked readonly.



    All the Google-fu in the world just reveals solutions to change permissions but I don't need to do that.



    My Dashcam marks videos/images readonly to save them when I press the button on it, but they're still in a folder with a few hundred MOV files, and I need a simple way to filter down to the ones I am looking for.










    share|improve this question









    New contributor




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























      3












      3








      3







      I need to list or show or query for the files in a folder (well, technically, on a USB drive, but I can navigate to it in Finder/Terminal) that are marked readonly.



      All the Google-fu in the world just reveals solutions to change permissions but I don't need to do that.



      My Dashcam marks videos/images readonly to save them when I press the button on it, but they're still in a folder with a few hundred MOV files, and I need a simple way to filter down to the ones I am looking for.










      share|improve this question









      New contributor




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











      I need to list or show or query for the files in a folder (well, technically, on a USB drive, but I can navigate to it in Finder/Terminal) that are marked readonly.



      All the Google-fu in the world just reveals solutions to change permissions but I don't need to do that.



      My Dashcam marks videos/images readonly to save them when I press the button on it, but they're still in a folder with a few hundred MOV files, and I need a simple way to filter down to the ones I am looking for.







      terminal finder permission






      share|improve this question









      New contributor




      Steven Evers 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 question









      New contributor




      Steven Evers 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 question




      share|improve this question








      edited 2 days ago









      Nimesh Neema

      14.8k43972




      14.8k43972






      New contributor




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









      asked 2 days ago









      Steven Evers

      1161




      1161




      New contributor




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





      New contributor





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






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






















          3 Answers
          3






          active

          oldest

          votes


















          1














          find . -type f -perm +444 ! -perm +222


          searches for all files (-type f) which are readable (-perm +444) but not writable (! +perm +222).



          If your mind boggles after reading up on -perm in man find you can also use the (significantly slower, especially on slow devices) option of processing the output of findyourself:



          find . -type f -print0 |
          xargs -0 -n 1 sh -c '[ -r "$1" -a ! -w "$1" ] && echo "$1"' sh


          This basically takes each file find finds, and runs it through a small shells script to check permissions.



          PS: Hey, I didn't say the second way is less mind-boggling :-)






          share|improve this answer



















          • 1




            Although the second method runs slower, it might be more accurate in certain situations if I am not mistaken with this example test for example: touch test_file; sudo chown root:staff test_file; (the first method fails to list the file, although it is a read-only file for the user)
            – Yoric
            2 days ago








          • 1




            @Yoric There is no general solution for this using find alone, see unix.stackexchange.com/questions/22421/… and the original question linked from there. In the case of the OP it's probably not an issue.
            – nohillside
            2 days ago






          • 1




            Thanks, my head is spinning right now, so much to learn digging into "simple questions" :)
            – Yoric
            2 days ago





















          1














          One way is to make use of the -w option in bash to check if the file is writable or not.



          Go into the directory you want to check your files, then enter:



          for RO in $(find . -type f);do [ -r "$RO" ] && [ ! -w "$RO" ] && echo $RO;done



          (credit to www.unix.com)



          [EDIT]



          To deal with spaces in file names, better to use the find -exec way rather than looping into the find:



          find . -type f -exec [ -r {} ] ; -exec [ ! -w {} ] ; -exec echo {} ;


          or



          find . -type f -exec [ -r {} ] ; -exec [ ! -w {} ] ; -print





          share|improve this answer










          New contributor




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


















          • Textually parsing the output from find usually breaks on file names containing space characters and similar. May not be a problem in the context the OP has, but might hit you in other circumstances.
            – nohillside
            2 days ago










          • @nohillside Thanks for the head up, I fixed the case replacing the for loop with using find -exec
            – Yoric
            2 days ago










          • My (hopefully) last remark on this: find . -type f -exec [ -r {} -a ! -w {} ] ; -print, much easier to read than the find ... | xargs ... sh -c monstrosity in my own answer :-)
            – nohillside
            2 days ago





















          -1














          List the files and grep for the read-only pattern:



          ls -l | grep '^-r--'



          ^ symbol indicates start the line.



          We are filtering only files here by mentioning ^-, after that looking only for read permission files by specifying r--. If you want to filter read & executable permission files, you can use r-x.



          If you want just the filename, you can use below command



          ls -l | grep '^-r--' | awk 'NF>1{print $NF}'



          Printing the file name using above command works, only if you don't have spaces in file name.






          share|improve this answer










          New contributor




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














          • 2




            Grepping the ls -l is a smart way to do it, but beware that your files might start with -rw-r--r-- with root as the owner, and such files won't be listed, even though they aren't writeable for the user.
            – Yoric
            2 days ago








          • 1




            grep ... | awk is usally not required, the second command can be rewritten as ls -l | awk '/^-r--/ {print $NF}'
            – nohillside
            2 days ago











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "118"
          };
          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',
          autoActivateHeartbeat: false,
          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
          });


          }
          });






          Steven Evers is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fapple.stackexchange.com%2fquestions%2f347110%2flist-readonly-files%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          3 Answers
          3






          active

          oldest

          votes








          3 Answers
          3






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          find . -type f -perm +444 ! -perm +222


          searches for all files (-type f) which are readable (-perm +444) but not writable (! +perm +222).



          If your mind boggles after reading up on -perm in man find you can also use the (significantly slower, especially on slow devices) option of processing the output of findyourself:



          find . -type f -print0 |
          xargs -0 -n 1 sh -c '[ -r "$1" -a ! -w "$1" ] && echo "$1"' sh


          This basically takes each file find finds, and runs it through a small shells script to check permissions.



          PS: Hey, I didn't say the second way is less mind-boggling :-)






          share|improve this answer



















          • 1




            Although the second method runs slower, it might be more accurate in certain situations if I am not mistaken with this example test for example: touch test_file; sudo chown root:staff test_file; (the first method fails to list the file, although it is a read-only file for the user)
            – Yoric
            2 days ago








          • 1




            @Yoric There is no general solution for this using find alone, see unix.stackexchange.com/questions/22421/… and the original question linked from there. In the case of the OP it's probably not an issue.
            – nohillside
            2 days ago






          • 1




            Thanks, my head is spinning right now, so much to learn digging into "simple questions" :)
            – Yoric
            2 days ago


















          1














          find . -type f -perm +444 ! -perm +222


          searches for all files (-type f) which are readable (-perm +444) but not writable (! +perm +222).



          If your mind boggles after reading up on -perm in man find you can also use the (significantly slower, especially on slow devices) option of processing the output of findyourself:



          find . -type f -print0 |
          xargs -0 -n 1 sh -c '[ -r "$1" -a ! -w "$1" ] && echo "$1"' sh


          This basically takes each file find finds, and runs it through a small shells script to check permissions.



          PS: Hey, I didn't say the second way is less mind-boggling :-)






          share|improve this answer



















          • 1




            Although the second method runs slower, it might be more accurate in certain situations if I am not mistaken with this example test for example: touch test_file; sudo chown root:staff test_file; (the first method fails to list the file, although it is a read-only file for the user)
            – Yoric
            2 days ago








          • 1




            @Yoric There is no general solution for this using find alone, see unix.stackexchange.com/questions/22421/… and the original question linked from there. In the case of the OP it's probably not an issue.
            – nohillside
            2 days ago






          • 1




            Thanks, my head is spinning right now, so much to learn digging into "simple questions" :)
            – Yoric
            2 days ago
















          1












          1








          1






          find . -type f -perm +444 ! -perm +222


          searches for all files (-type f) which are readable (-perm +444) but not writable (! +perm +222).



          If your mind boggles after reading up on -perm in man find you can also use the (significantly slower, especially on slow devices) option of processing the output of findyourself:



          find . -type f -print0 |
          xargs -0 -n 1 sh -c '[ -r "$1" -a ! -w "$1" ] && echo "$1"' sh


          This basically takes each file find finds, and runs it through a small shells script to check permissions.



          PS: Hey, I didn't say the second way is less mind-boggling :-)






          share|improve this answer














          find . -type f -perm +444 ! -perm +222


          searches for all files (-type f) which are readable (-perm +444) but not writable (! +perm +222).



          If your mind boggles after reading up on -perm in man find you can also use the (significantly slower, especially on slow devices) option of processing the output of findyourself:



          find . -type f -print0 |
          xargs -0 -n 1 sh -c '[ -r "$1" -a ! -w "$1" ] && echo "$1"' sh


          This basically takes each file find finds, and runs it through a small shells script to check permissions.



          PS: Hey, I didn't say the second way is less mind-boggling :-)







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 2 days ago

























          answered 2 days ago









          nohillside

          50.9k13109149




          50.9k13109149








          • 1




            Although the second method runs slower, it might be more accurate in certain situations if I am not mistaken with this example test for example: touch test_file; sudo chown root:staff test_file; (the first method fails to list the file, although it is a read-only file for the user)
            – Yoric
            2 days ago








          • 1




            @Yoric There is no general solution for this using find alone, see unix.stackexchange.com/questions/22421/… and the original question linked from there. In the case of the OP it's probably not an issue.
            – nohillside
            2 days ago






          • 1




            Thanks, my head is spinning right now, so much to learn digging into "simple questions" :)
            – Yoric
            2 days ago
















          • 1




            Although the second method runs slower, it might be more accurate in certain situations if I am not mistaken with this example test for example: touch test_file; sudo chown root:staff test_file; (the first method fails to list the file, although it is a read-only file for the user)
            – Yoric
            2 days ago








          • 1




            @Yoric There is no general solution for this using find alone, see unix.stackexchange.com/questions/22421/… and the original question linked from there. In the case of the OP it's probably not an issue.
            – nohillside
            2 days ago






          • 1




            Thanks, my head is spinning right now, so much to learn digging into "simple questions" :)
            – Yoric
            2 days ago










          1




          1




          Although the second method runs slower, it might be more accurate in certain situations if I am not mistaken with this example test for example: touch test_file; sudo chown root:staff test_file; (the first method fails to list the file, although it is a read-only file for the user)
          – Yoric
          2 days ago






          Although the second method runs slower, it might be more accurate in certain situations if I am not mistaken with this example test for example: touch test_file; sudo chown root:staff test_file; (the first method fails to list the file, although it is a read-only file for the user)
          – Yoric
          2 days ago






          1




          1




          @Yoric There is no general solution for this using find alone, see unix.stackexchange.com/questions/22421/… and the original question linked from there. In the case of the OP it's probably not an issue.
          – nohillside
          2 days ago




          @Yoric There is no general solution for this using find alone, see unix.stackexchange.com/questions/22421/… and the original question linked from there. In the case of the OP it's probably not an issue.
          – nohillside
          2 days ago




          1




          1




          Thanks, my head is spinning right now, so much to learn digging into "simple questions" :)
          – Yoric
          2 days ago






          Thanks, my head is spinning right now, so much to learn digging into "simple questions" :)
          – Yoric
          2 days ago















          1














          One way is to make use of the -w option in bash to check if the file is writable or not.



          Go into the directory you want to check your files, then enter:



          for RO in $(find . -type f);do [ -r "$RO" ] && [ ! -w "$RO" ] && echo $RO;done



          (credit to www.unix.com)



          [EDIT]



          To deal with spaces in file names, better to use the find -exec way rather than looping into the find:



          find . -type f -exec [ -r {} ] ; -exec [ ! -w {} ] ; -exec echo {} ;


          or



          find . -type f -exec [ -r {} ] ; -exec [ ! -w {} ] ; -print





          share|improve this answer










          New contributor




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


















          • Textually parsing the output from find usually breaks on file names containing space characters and similar. May not be a problem in the context the OP has, but might hit you in other circumstances.
            – nohillside
            2 days ago










          • @nohillside Thanks for the head up, I fixed the case replacing the for loop with using find -exec
            – Yoric
            2 days ago










          • My (hopefully) last remark on this: find . -type f -exec [ -r {} -a ! -w {} ] ; -print, much easier to read than the find ... | xargs ... sh -c monstrosity in my own answer :-)
            – nohillside
            2 days ago


















          1














          One way is to make use of the -w option in bash to check if the file is writable or not.



          Go into the directory you want to check your files, then enter:



          for RO in $(find . -type f);do [ -r "$RO" ] && [ ! -w "$RO" ] && echo $RO;done



          (credit to www.unix.com)



          [EDIT]



          To deal with spaces in file names, better to use the find -exec way rather than looping into the find:



          find . -type f -exec [ -r {} ] ; -exec [ ! -w {} ] ; -exec echo {} ;


          or



          find . -type f -exec [ -r {} ] ; -exec [ ! -w {} ] ; -print





          share|improve this answer










          New contributor




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


















          • Textually parsing the output from find usually breaks on file names containing space characters and similar. May not be a problem in the context the OP has, but might hit you in other circumstances.
            – nohillside
            2 days ago










          • @nohillside Thanks for the head up, I fixed the case replacing the for loop with using find -exec
            – Yoric
            2 days ago










          • My (hopefully) last remark on this: find . -type f -exec [ -r {} -a ! -w {} ] ; -print, much easier to read than the find ... | xargs ... sh -c monstrosity in my own answer :-)
            – nohillside
            2 days ago
















          1












          1








          1






          One way is to make use of the -w option in bash to check if the file is writable or not.



          Go into the directory you want to check your files, then enter:



          for RO in $(find . -type f);do [ -r "$RO" ] && [ ! -w "$RO" ] && echo $RO;done



          (credit to www.unix.com)



          [EDIT]



          To deal with spaces in file names, better to use the find -exec way rather than looping into the find:



          find . -type f -exec [ -r {} ] ; -exec [ ! -w {} ] ; -exec echo {} ;


          or



          find . -type f -exec [ -r {} ] ; -exec [ ! -w {} ] ; -print





          share|improve this answer










          New contributor




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









          One way is to make use of the -w option in bash to check if the file is writable or not.



          Go into the directory you want to check your files, then enter:



          for RO in $(find . -type f);do [ -r "$RO" ] && [ ! -w "$RO" ] && echo $RO;done



          (credit to www.unix.com)



          [EDIT]



          To deal with spaces in file names, better to use the find -exec way rather than looping into the find:



          find . -type f -exec [ -r {} ] ; -exec [ ! -w {} ] ; -exec echo {} ;


          or



          find . -type f -exec [ -r {} ] ; -exec [ ! -w {} ] ; -print






          share|improve this answer










          New contributor




          Yoric 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








          edited 2 days ago









          nohillside

          50.9k13109149




          50.9k13109149






          New contributor




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









          answered 2 days ago









          Yoric

          2685




          2685




          New contributor




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





          New contributor





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






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












          • Textually parsing the output from find usually breaks on file names containing space characters and similar. May not be a problem in the context the OP has, but might hit you in other circumstances.
            – nohillside
            2 days ago










          • @nohillside Thanks for the head up, I fixed the case replacing the for loop with using find -exec
            – Yoric
            2 days ago










          • My (hopefully) last remark on this: find . -type f -exec [ -r {} -a ! -w {} ] ; -print, much easier to read than the find ... | xargs ... sh -c monstrosity in my own answer :-)
            – nohillside
            2 days ago




















          • Textually parsing the output from find usually breaks on file names containing space characters and similar. May not be a problem in the context the OP has, but might hit you in other circumstances.
            – nohillside
            2 days ago










          • @nohillside Thanks for the head up, I fixed the case replacing the for loop with using find -exec
            – Yoric
            2 days ago










          • My (hopefully) last remark on this: find . -type f -exec [ -r {} -a ! -w {} ] ; -print, much easier to read than the find ... | xargs ... sh -c monstrosity in my own answer :-)
            – nohillside
            2 days ago


















          Textually parsing the output from find usually breaks on file names containing space characters and similar. May not be a problem in the context the OP has, but might hit you in other circumstances.
          – nohillside
          2 days ago




          Textually parsing the output from find usually breaks on file names containing space characters and similar. May not be a problem in the context the OP has, but might hit you in other circumstances.
          – nohillside
          2 days ago












          @nohillside Thanks for the head up, I fixed the case replacing the for loop with using find -exec
          – Yoric
          2 days ago




          @nohillside Thanks for the head up, I fixed the case replacing the for loop with using find -exec
          – Yoric
          2 days ago












          My (hopefully) last remark on this: find . -type f -exec [ -r {} -a ! -w {} ] ; -print, much easier to read than the find ... | xargs ... sh -c monstrosity in my own answer :-)
          – nohillside
          2 days ago






          My (hopefully) last remark on this: find . -type f -exec [ -r {} -a ! -w {} ] ; -print, much easier to read than the find ... | xargs ... sh -c monstrosity in my own answer :-)
          – nohillside
          2 days ago













          -1














          List the files and grep for the read-only pattern:



          ls -l | grep '^-r--'



          ^ symbol indicates start the line.



          We are filtering only files here by mentioning ^-, after that looking only for read permission files by specifying r--. If you want to filter read & executable permission files, you can use r-x.



          If you want just the filename, you can use below command



          ls -l | grep '^-r--' | awk 'NF>1{print $NF}'



          Printing the file name using above command works, only if you don't have spaces in file name.






          share|improve this answer










          New contributor




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














          • 2




            Grepping the ls -l is a smart way to do it, but beware that your files might start with -rw-r--r-- with root as the owner, and such files won't be listed, even though they aren't writeable for the user.
            – Yoric
            2 days ago








          • 1




            grep ... | awk is usally not required, the second command can be rewritten as ls -l | awk '/^-r--/ {print $NF}'
            – nohillside
            2 days ago
















          -1














          List the files and grep for the read-only pattern:



          ls -l | grep '^-r--'



          ^ symbol indicates start the line.



          We are filtering only files here by mentioning ^-, after that looking only for read permission files by specifying r--. If you want to filter read & executable permission files, you can use r-x.



          If you want just the filename, you can use below command



          ls -l | grep '^-r--' | awk 'NF>1{print $NF}'



          Printing the file name using above command works, only if you don't have spaces in file name.






          share|improve this answer










          New contributor




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














          • 2




            Grepping the ls -l is a smart way to do it, but beware that your files might start with -rw-r--r-- with root as the owner, and such files won't be listed, even though they aren't writeable for the user.
            – Yoric
            2 days ago








          • 1




            grep ... | awk is usally not required, the second command can be rewritten as ls -l | awk '/^-r--/ {print $NF}'
            – nohillside
            2 days ago














          -1












          -1








          -1






          List the files and grep for the read-only pattern:



          ls -l | grep '^-r--'



          ^ symbol indicates start the line.



          We are filtering only files here by mentioning ^-, after that looking only for read permission files by specifying r--. If you want to filter read & executable permission files, you can use r-x.



          If you want just the filename, you can use below command



          ls -l | grep '^-r--' | awk 'NF>1{print $NF}'



          Printing the file name using above command works, only if you don't have spaces in file name.






          share|improve this answer










          New contributor




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









          List the files and grep for the read-only pattern:



          ls -l | grep '^-r--'



          ^ symbol indicates start the line.



          We are filtering only files here by mentioning ^-, after that looking only for read permission files by specifying r--. If you want to filter read & executable permission files, you can use r-x.



          If you want just the filename, you can use below command



          ls -l | grep '^-r--' | awk 'NF>1{print $NF}'



          Printing the file name using above command works, only if you don't have spaces in file name.







          share|improve this answer










          New contributor




          BarathVutukuri 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








          edited 2 days ago





















          New contributor




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









          answered 2 days ago









          BarathVutukuri

          1272




          1272




          New contributor




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





          New contributor





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






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








          • 2




            Grepping the ls -l is a smart way to do it, but beware that your files might start with -rw-r--r-- with root as the owner, and such files won't be listed, even though they aren't writeable for the user.
            – Yoric
            2 days ago








          • 1




            grep ... | awk is usally not required, the second command can be rewritten as ls -l | awk '/^-r--/ {print $NF}'
            – nohillside
            2 days ago














          • 2




            Grepping the ls -l is a smart way to do it, but beware that your files might start with -rw-r--r-- with root as the owner, and such files won't be listed, even though they aren't writeable for the user.
            – Yoric
            2 days ago








          • 1




            grep ... | awk is usally not required, the second command can be rewritten as ls -l | awk '/^-r--/ {print $NF}'
            – nohillside
            2 days ago








          2




          2




          Grepping the ls -l is a smart way to do it, but beware that your files might start with -rw-r--r-- with root as the owner, and such files won't be listed, even though they aren't writeable for the user.
          – Yoric
          2 days ago






          Grepping the ls -l is a smart way to do it, but beware that your files might start with -rw-r--r-- with root as the owner, and such files won't be listed, even though they aren't writeable for the user.
          – Yoric
          2 days ago






          1




          1




          grep ... | awk is usally not required, the second command can be rewritten as ls -l | awk '/^-r--/ {print $NF}'
          – nohillside
          2 days ago




          grep ... | awk is usally not required, the second command can be rewritten as ls -l | awk '/^-r--/ {print $NF}'
          – nohillside
          2 days ago










          Steven Evers is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Steven Evers is a new contributor. Be nice, and check out our Code of Conduct.













          Steven Evers is a new contributor. Be nice, and check out our Code of Conduct.












          Steven Evers is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Ask Different!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fapple.stackexchange.com%2fquestions%2f347110%2flist-readonly-files%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

          If I really need a card on my start hand, how many mulligans make sense? [duplicate]

          Alcedinidae