Search a directory for all files with a string in the file name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MikeCant
    New Member
    • Jan 2022
    • 2

    Search a directory for all files with a string in the file name

    How do i search all the files in a directory in linux and get al list of all the files with the string "hello" in the name? Including subdirectories.
  • SioSio
    Contributor
    • Dec 2019
    • 272

    #2
    The command shown below searches for files below the current directory.

    If you want to display the directory, use the find command.
    find . -name "*hello*" -print
    or
    use the du and grep command.
    du -a | grep hello
    If you don't want to see the directory, use the ls and grep command.
    ls -R | grep hello

    Comment

    Working...