Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vasilii-b/2bd591715112ca02268a37cf333efa94 to your computer and use it in GitHub Desktop.
Save vasilii-b/2bd591715112ca02268a37cf333efa94 to your computer and use it in GitHub Desktop.
Linux CLI: find filenames and execute a command on the files (without file extension)
#!/bin/bash
# get files without the extension
files=$(find ./ -name "filename*.html" -execdir basename {} .html \;)
for FILENAME in ${files}
do
#some-command-with-filename-as-param ${FILENAME};
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment