Welcome to the Linux Foundation Forum!

command line to search files and save output to a file

Options

Hi all,

Please advise the command line to find all files containing a string "Deny from all" on ./ and save all files found to a file (which not created yet)

Thanks

Regards

Answers

  • mulyadi.santosa
    Options

    I think try:

    grep -l 'Deny from all' /home/ > /tmp/list.txt

    /tmp/list.txt is of course can be changed to any file name or folder name you wish

Categories

Upcoming Training