0

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?

TravelWhere
  • 117
  • 1
  • 5

2 Answers2

1

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

1

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

NiKiZe
  • 1,246
  • 8
  • 20