How do you delete files older than specific date in Linux?
Feb 9, 2025 · 96 I used the below command to delete files older than a year. find /path/* -mtime +365 -exec rm -rf {} \; But now I want to delete all files whose modified time is older than 01 Jan …
How to recover files I deleted now by running rm - Unix & Linux …
How to recover files I deleted now by running rm *? [duplicate] Ask Question Asked 12 years, 1 month ago Modified 5 years, 5 months ago
Delete files older than X days - Unix & Linux Stack Exchange
Apr 7, 2015 · I have found the command to delete files older than 5 days in a folder find /path/to/files* -mtime +5 -exec rm {} \\; But how do I also do this for subdirectories in that folder?
What's the fastest way to remove all files & subfolders in a ... - linux
Apr 18, 2016 · It's expected for rm -rf (or anything that removes every file) to be expensive as it means reading the content of all directories and calling unlink() on every entry. unlink() itself …
linux - Delete matching files in all subdirectories - Super User
Feb 22, 2010 · Remove all *.swp files underneath the current directory, use the find command in one of the following forms: find . -name \*.swp -type f -delete The -delete option means find will …
linux - rm fails to delete files by wildcard from a script, but works ...
77 I've run into a really silly problem with a Linux shell script. I want to delete all files with the extension ".bz2" in a directory. In the script I call
linux - rm -rf takes a long time - Super User
May 5, 2020 · 3 Usually if a directory has too many and large files, running the command rm -rf will not help because it can cause the server to hang, this is the command that I usually use : ls …
rm - Remove files and subdirectories of particular folder - Unix ...
Sep 1, 2015 · I need to remove files and sub-directories in a particular folder but not that folder itself. I am using below command: find . -type d -depth -mtime +7 -exec rm -rf {} \\; But it throws …
linux - How do I deal with a filename that starts with the hyphen ...
Apr 16, 2011 · Because rm, cat, mv, etc. are all POSIX-standardized, they're required to comply except where the standard's documentation for that individual command indicates otherwise.
linux - Why does rm manual say that we can run it without any …
Nov 23, 2019 · This confirms that it must be possible to run rm -f without any pathname operands and that this is not something that makes rm exit with a diagnostic message nor a non-zero …