How can I remove a directory of many files quicker? [duplicate]
Clash Royale CLAN TAG#URR8PPP
up vote
-2
down vote
favorite
This question already has an answer here:
What's the fastest way to remove all files & subfolders in a directory? [duplicate]
4 answers
How can I remove a directory of many files fast?
For example, I backup my hard drive on an external drive, and when I need to release the space occupied by some very old backup on the external drive, I want to release the space as soon as possible.rm -r /very/old/backup
takes very long to finish running.
Thanks.
linux files
marked as duplicate by ñÃÂsýù÷, G-Man, Stephen Rauch, muru, taliezin Nov 6 '17 at 7:51
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |Â
up vote
-2
down vote
favorite
This question already has an answer here:
What's the fastest way to remove all files & subfolders in a directory? [duplicate]
4 answers
How can I remove a directory of many files fast?
For example, I backup my hard drive on an external drive, and when I need to release the space occupied by some very old backup on the external drive, I want to release the space as soon as possible.rm -r /very/old/backup
takes very long to finish running.
Thanks.
linux files
marked as duplicate by ñÃÂsýù÷, G-Man, Stephen Rauch, muru, taliezin Nov 6 '17 at 7:51
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Is there a solution faster thanrm -r /very/old/backup
in the link you gave? Or am I missing something?
â Tim
Nov 6 '17 at 4:48
1
Yeah,rsync
there is super faster.
â Ã±ÃÂsýù÷
Nov 6 '17 at 4:50
rsync was the slowest of the three, rm being fastest and find second.
â Jasen
Nov 6 '17 at 9:24
the best answer may be to change the way you do backups, rsync has some really useful features that can save both space and time.
â Jasen
Nov 6 '17 at 9:26
add a comment |Â
up vote
-2
down vote
favorite
up vote
-2
down vote
favorite
This question already has an answer here:
What's the fastest way to remove all files & subfolders in a directory? [duplicate]
4 answers
How can I remove a directory of many files fast?
For example, I backup my hard drive on an external drive, and when I need to release the space occupied by some very old backup on the external drive, I want to release the space as soon as possible.rm -r /very/old/backup
takes very long to finish running.
Thanks.
linux files
This question already has an answer here:
What's the fastest way to remove all files & subfolders in a directory? [duplicate]
4 answers
How can I remove a directory of many files fast?
For example, I backup my hard drive on an external drive, and when I need to release the space occupied by some very old backup on the external drive, I want to release the space as soon as possible.rm -r /very/old/backup
takes very long to finish running.
Thanks.
This question already has an answer here:
What's the fastest way to remove all files & subfolders in a directory? [duplicate]
4 answers
linux files
asked Nov 6 '17 at 4:33
Tim
22.9k66225407
22.9k66225407
marked as duplicate by ñÃÂsýù÷, G-Man, Stephen Rauch, muru, taliezin Nov 6 '17 at 7:51
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by ñÃÂsýù÷, G-Man, Stephen Rauch, muru, taliezin Nov 6 '17 at 7:51
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Is there a solution faster thanrm -r /very/old/backup
in the link you gave? Or am I missing something?
â Tim
Nov 6 '17 at 4:48
1
Yeah,rsync
there is super faster.
â Ã±ÃÂsýù÷
Nov 6 '17 at 4:50
rsync was the slowest of the three, rm being fastest and find second.
â Jasen
Nov 6 '17 at 9:24
the best answer may be to change the way you do backups, rsync has some really useful features that can save both space and time.
â Jasen
Nov 6 '17 at 9:26
add a comment |Â
Is there a solution faster thanrm -r /very/old/backup
in the link you gave? Or am I missing something?
â Tim
Nov 6 '17 at 4:48
1
Yeah,rsync
there is super faster.
â Ã±ÃÂsýù÷
Nov 6 '17 at 4:50
rsync was the slowest of the three, rm being fastest and find second.
â Jasen
Nov 6 '17 at 9:24
the best answer may be to change the way you do backups, rsync has some really useful features that can save both space and time.
â Jasen
Nov 6 '17 at 9:26
Is there a solution faster than
rm -r /very/old/backup
in the link you gave? Or am I missing something?â Tim
Nov 6 '17 at 4:48
Is there a solution faster than
rm -r /very/old/backup
in the link you gave? Or am I missing something?â Tim
Nov 6 '17 at 4:48
1
1
Yeah,
rsync
there is super faster.â Ã±ÃÂsýù÷
Nov 6 '17 at 4:50
Yeah,
rsync
there is super faster.â Ã±ÃÂsýù÷
Nov 6 '17 at 4:50
rsync was the slowest of the three, rm being fastest and find second.
â Jasen
Nov 6 '17 at 9:24
rsync was the slowest of the three, rm being fastest and find second.
â Jasen
Nov 6 '17 at 9:24
the best answer may be to change the way you do backups, rsync has some really useful features that can save both space and time.
â Jasen
Nov 6 '17 at 9:26
the best answer may be to change the way you do backups, rsync has some really useful features that can save both space and time.
â Jasen
Nov 6 '17 at 9:26
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
Technically, this depends on the filesystem and the structure that's been set up for it. But in the normal case of UFS/EXT, the system has to visit each individual file to release space. In the case where you have many small files, it can take quite a while to walk the directory to release space.
Because your usage is as a backup, you might consider changing the layout before you need the space back. One option is to take the directory (potentially with many small files) and tar or zip it up. This will take some time, but can be done any time after the backup. When you have the archive file in place, delete the directory. At the end of the process, you have a single file on the filesystem, and can still pull any data you need from it.
When it's time to remove, you can rm
a single file, which will go much more quickly.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Technically, this depends on the filesystem and the structure that's been set up for it. But in the normal case of UFS/EXT, the system has to visit each individual file to release space. In the case where you have many small files, it can take quite a while to walk the directory to release space.
Because your usage is as a backup, you might consider changing the layout before you need the space back. One option is to take the directory (potentially with many small files) and tar or zip it up. This will take some time, but can be done any time after the backup. When you have the archive file in place, delete the directory. At the end of the process, you have a single file on the filesystem, and can still pull any data you need from it.
When it's time to remove, you can rm
a single file, which will go much more quickly.
add a comment |Â
up vote
1
down vote
Technically, this depends on the filesystem and the structure that's been set up for it. But in the normal case of UFS/EXT, the system has to visit each individual file to release space. In the case where you have many small files, it can take quite a while to walk the directory to release space.
Because your usage is as a backup, you might consider changing the layout before you need the space back. One option is to take the directory (potentially with many small files) and tar or zip it up. This will take some time, but can be done any time after the backup. When you have the archive file in place, delete the directory. At the end of the process, you have a single file on the filesystem, and can still pull any data you need from it.
When it's time to remove, you can rm
a single file, which will go much more quickly.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Technically, this depends on the filesystem and the structure that's been set up for it. But in the normal case of UFS/EXT, the system has to visit each individual file to release space. In the case where you have many small files, it can take quite a while to walk the directory to release space.
Because your usage is as a backup, you might consider changing the layout before you need the space back. One option is to take the directory (potentially with many small files) and tar or zip it up. This will take some time, but can be done any time after the backup. When you have the archive file in place, delete the directory. At the end of the process, you have a single file on the filesystem, and can still pull any data you need from it.
When it's time to remove, you can rm
a single file, which will go much more quickly.
Technically, this depends on the filesystem and the structure that's been set up for it. But in the normal case of UFS/EXT, the system has to visit each individual file to release space. In the case where you have many small files, it can take quite a while to walk the directory to release space.
Because your usage is as a backup, you might consider changing the layout before you need the space back. One option is to take the directory (potentially with many small files) and tar or zip it up. This will take some time, but can be done any time after the backup. When you have the archive file in place, delete the directory. At the end of the process, you have a single file on the filesystem, and can still pull any data you need from it.
When it's time to remove, you can rm
a single file, which will go much more quickly.
answered Nov 6 '17 at 4:47
BowlOfRed
2,335612
2,335612
add a comment |Â
add a comment |Â
Is there a solution faster than
rm -r /very/old/backup
in the link you gave? Or am I missing something?â Tim
Nov 6 '17 at 4:48
1
Yeah,
rsync
there is super faster.â Ã±ÃÂsýù÷
Nov 6 '17 at 4:50
rsync was the slowest of the three, rm being fastest and find second.
â Jasen
Nov 6 '17 at 9:24
the best answer may be to change the way you do backups, rsync has some really useful features that can save both space and time.
â Jasen
Nov 6 '17 at 9:26