purge
Delete all files except the newest 3 in bash script
This will list all files except the newest three: ls -t | tail -n +4 This will delete those files: ls -t | tail -n +4 | xargs rm — This will also list dotfiles: ls -At | tail -n +4 and delete with dotfiles: ls -At | tail -n +4 | xargs rm — … Read more
How to automatically remove all .orig files in Mercurial working tree?
Personally, I use $ rm **/*.orig if I get tired of the .orig files. This works in Zsh and in Bash 4 after you run shopt -s globstar. But if you use another shell or want a built-in solution, then maybe you’ll like the purge extension (link updated 2016-08-25). That lets you remove all untracked … Read more
How do I purge a linux mail box with huge number of emails? [closed]
alternative way: mail -N d * quit -N Inhibits the initial display of message headers when reading mail or editing a mail folder. d * delete all mails
Is there a way to purge the topic in Kafka?
Temporarily update the retention time on the topic to one second: kafka-topics.sh \ –zookeeper <zkhost>:2181 \ –alter \ –topic <topic name> \ –config retention.ms=1000 And in newer Kafka releases, you can also do it with kafka-configs –entity-type topics kafka-configs.sh \ –zookeeper <zkhost>:2181 \ –entity-type topics \ –alter \ –entity-name <topic name> \ –add-config retention.ms=1000 then … Read more