Ls grep add all jpg file to txt in directory

broken image
broken image
broken image

For best results you may want to run this command as root. The 2>/dev/null part is there to ignore errors such as when you try reading from files without permissions, like you seem to be doing (based on your answer to Imre L's answer). Normally the list of matching files can be accomplished simply by running: grep -l MY_Output dev/*/* dev/.?*/* dev/*/.?* dev/.?*/.?* 2>/dev/null Using these four patterns ensures that you process all the files you want and that you don't get extra matches from other (deeper or shallower) files. This is a detail that is missing from secretmike's and Brian Showalter's solutions. More precisely, since the '*' pattern does not match files or directories starting with a '.', you would also want to search for dev/*/*, dev/.?*/*, dev/*/.?* and dev/.?*/.?*. As I understand it, in general terms you want to list which folders contain regular files called dev/*/* which themselves contain the string ' MY_Output' (case sensitive).

broken image