Can I remove the original file while running "sort"?
Posted
by
Spaceman
on Super User
See other posts from Super User
or by Spaceman
Published on 2014-05-29T08:56:26Z
Indexed on
2014/05/29
9:32 UTC
Read the original article
Hit count: 149
I'm sorting a huge file, around 400 gigabytes. I'm running out of the disk space and I must do something quickly.
Let's assume the original file is called original_file. So I execute (simplified) it as "sort original_file | gzip -c > output_file"
I use /home/tmp as a temporary dir. From what I see, there are a lot of intermediate files, like so:
tmpA465
tmpB154
...
and so on.
The smallest ones have size 12 megabytes.
The largest have ~182 megabytes.
So, it seems that the "sort" command have already split the original file into small pieces, and have sorted them, and now it is merging them into bigger parts (which will be, eventually, sorted as well). Please correct me if I'm wrong.
Can I remove the original file right now without terminating the sort process? I've been waiting for a few days for that and it's important that the "sort" command will not fail and I will get the result file, finally.
The OS is Ubuntu server 13.04, x64.
Thanks!
© Super User or respective owner