I'd like to find all the files suffix with
find ~ -iregex ".*\.md$" find ~ -iregex ".*\.org$"
How could combine them?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
Just concatenate your search like says in this answer :
find ~ -name "*.md" -o -name "*.org"
-namewould do the search recursively (remove it if you don't want to have subdirectories result)
-ooption represents an OR operator (it would execute both commands even if there is no
~is the path where you want to start the
findexecution; here, you begins at
useris your username)
P.S : if you want to use
(), you need to use the escape character
\ like that :
find ~ \( -name "*.md" -o -name "*.org" \)
Both of these commands works, but the first is enough in this case.
P.P.S : in case that you want to find files that would got these extensions with uppercases, use the
-iname option instead of
-name option, like that :
find ~ -iname "*.md" -o -iname "*.org"
You would be able to find files named like README.MD for example, which aren't shown with the