Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a better way to join files that have been splitted than just doing a "cat" or "join"? These commands just copy the file streams into a new file on disk. A much better way would be manipulating the filesystem pointers to join the files into one big continuous file. Of course this would be filesystem specific. Is there something available for ext2 or ext3?

share|improve this question
Yes. And it makes no sense for this kind of special case to be in userspace. It would break the whole idea of the filesystem abstraction. – gtrak Jul 11 '10 at 19:32

No, the correct way to split files is:

split bigfile

and conCATenate them:

cat x* > newbigfile

Trying to do this with the underlying filesystem is the wrong approach if for no other reason than it wouldn't be portable.

share|improve this answer
There are several use cases where portability is not the primary issue. Partition tools work with these kinds of issues all the time. I can't see why this shouldn't be available - at least for a root user. – Eddy Yosso Jul 12 '10 at 9:51
See part of Gary's answer. Filesystem abstraction would be broken. You're catting files, not manipulating filesystems. That's the difference between split/cat and parted. The rest of the OS wouldn't have any idea why all of a sudden something weird happened to some otherwise perfectly normal files. I wouldn't run such a utility except on an unmounted filesystem. – Dennis Williamson Jul 12 '10 at 11:59

Once I had one file with 2Gb and I wanted to add a file at the header of that.

I would cat a new file, but was concerned about performance.

So I ended up using "vi" on the big file and typed :read header.txt at the beginning of the file, then save it.

It worked, and faster than cat.

Maybe "vi" is clever at rewriting the file, I've never seen the code, though.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.