Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Shell/Bash
how to remove all files in a directory matching a regex pattern shell
Mila
Programming language:
Shell/Bash
2021-07-04 02:28:42
0
Q:
how to remove all files in a directory matching a regex pattern shell
Rod C
Code:
Shell/Bash
2021-03-04 13:51:41
ls | grep -P "^A.*[0-9]{2}$" | xargs -d"\n" rm
0
Tags
file
files
shell
remove
how
Related
shell find string in directory
linux strip foldder name from path
powershell delete all files with specific extension in sub directories
remove all files inside directory linux
linux remove all files same extension in directory
linux sed remove string in file
how to erase folder that match characters in linux
grep extract only matched string
delete strings after match to eol using sed command
deletes lines including regex match
find number of occurances of a string in a file shell
linux how to remove all files with grep
New to Communities?
Join the community