Search code examples
command

I want to display only the name of the files in the current directory and sub-directores without the file extensions


..../here is the code, it shows the files but it added the extension .sh I want to display them without the .sh

//

find -type f -name "*.sh" -printf "%f\n"


Solution

  • I found the answer to my question and it worked

    See below my answer ... thank you!

    find -type f -name ".sh" -not ".sh" -printf "%f\n" -Exclude *.sh
    

    The find -type f -name ".sh" - these are files that I want to find -Exclude *.sh => this part will exclude the files extension which is the .sh