Reputation: 1
i have some issue having a directory LOG. in that so many files and directories are there. i want to find and delete the file which starts with PS. but it should not check sub directories.
Upvotes: 0
Views: 1841
Reputation: 63708
Use find
tool with maxdepth
option:
find LOG-PATH -maxdepth 1 -regextype "posix-egrep" -regex '.*/PS.*' -type f -exec rm {} \;
Upvotes: 4