Answer the question
In order to leave comments, you need to log in
How to delete files with the same extension in a specific folder on Unix-like?
What is even up, programmer.
find. -type f -name '*.jpg' -exec rm {} +
Here is the command that worked for me.
I needed to delete all files with the appropriate extension in the directory that I was, but this command is not logically clear to me. There is something more logically clear, like ". rm -a ".jpg"
And yes, if this command is nevertheless good, then explain it sequentially.
Answer the question
In order to leave comments, you need to log in
Find: find
Where? In current directory: .
What? Files: -type f
Everything in a row? No, according to the pattern: -name '*.jpg'
What to do with the result? Divide the result into groups and call the rm command for each group, where {} + is a group of files: -exec rm {} +
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question