Bash output redirection limits?

I am trying to merge large files (some GB) in bash. I tried

cat file1 file2 file3 > result 

and he did not work until

  cat file1 file2 file3 >> result 

have worked. In both cases, the result of the file did not exist before, and I expected both commands to give the same result.

On the same system, I tried the same with small files (just a few bytes), and both commands produce the same output. I tried to find some explanation (for example here ), but could not find ...

So, I know how to solve my problem, but I'm still puzzled. Can anyone create a key?

+6
source share
1 answer

when I need to split the file, I use a trick that works very well:

 tar --one-file-system -czv /home | split -b 4000m - /media/DRIVENAME/BACKUPNAME.tgz 

then to recover:

cat /media/DRIVENAME/BACKUPNAME.tgz.* | tar -x /

therefore, the cat does the work regardless of the contents. Therefore, if this does not work, is there a bad production of your split files or a limitation of your file system. What file system are you using?

+1
source

All Articles