Score:0

How to delete specific files?

cn flag

I'm running Ubuntu 20.04. I have a directory with million of files named like this

master-stdout.log.20210801.024908
master-stdout.log.20210801.025524
master-stdout.log.20210801.064355

How can I delete all of master-stdout.log files?

Score:1
in flag

If you get Argument list too long there is to many files, but there is workarounds...

find . -name "master-stdout.log.*" -print0 | xargs -0 rm

Based on https://stackoverflow.com/a/11289567/2716218

Score:1
ca flag

You can do rm master-stdout.log.* (remember the *)

TravelWhere avatar
cn flag
doesn't work it gives error: /bin/rm: Argument list too long
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.