Problems activating your account? Send notification email to: admin@post4vps.com
Host4Fun Budget VPS Hosting

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Join split files (.001, .002, ...) easily on Linux
#1
Hello everyone

I switched to Manjaro Linux as my main OS on my desktop computer. A few days passed so far and I haven't had any real issues. Today however one of my favorite online podcasts has been released. Their offline release is always split up into multiple files with extensions like .001, .002 and so on (depending on the size). That's where the first problem arised.

Before switching to Linux I have been using Windows and always had 7Zip installed. Here is where 7Zip played a big role. The 7Zip archive manager handles .001 and etc. files very well. So I could always use it to simply "extract" the full file (extract in quotes as 7Zip probably just joins them instead of really extracting them). Tried the same on Linux now but it seems the graphical archive manager doesn't support this. In fact it didn't even recognize the extensions. Only the first file ending with .001 was recognized by my video player MPV. What good is it if you can play only one half of the file? Nothing, indeed.

So I did some research and by nature Linux comes with a very handy and small tool called "cat". Most of us have heard about it already and have used it during a lot of tasks. And once again this handy tool has come to help. You can easily join split files with extensions like .001 to .XXX (undefined amount of parts) with a single cat command in the terminal.


How to join split files with cat:

0. Open up a terminal if you're using a graphical environment.


1. Navigate to the place where the split files are stored using the cd command (e.g. cd /home/username/Downloads).


2. Execute the following command:
cat filename.ext.* > filename.ext

Example:
cat online-podcast-recording.mkv.* > online-podcast-recording.mkv


Alternatives are:
cat filename.ext.001 filename.ext.002 filename.ext.XXX > filename.ext

Example:
cat online-podcast-recording.mkv.001 online-podcast-recording.mkv.002 > online-podcast-recording.mkv


Or
cat filename.ext.[0-9][0-9][0-9] > filename.ext

Example:
cat online-podcast-recording.mkv.[0-9][0-9][0-9] > online-podcast-recording.mkv


For the second method it just really depends on how many parts the file has. So you have to include all parts into the command.


3. Now wait a little while. Depending on the overall file size it just takes time to join the size (also pretty much depends on the power of your computer and storage speed).


4. Success Smile. You have the joined file in the same directory where the split files are. You can check the file and if everything is complete you can delete the split files.


I'm aware that this is a very simple guide and probably quite unnecessary but this is one of the things that you might run into when switching main OSs. Just documenting it for the future. And in my humble opinion this is quite cool because you don't even need any additional software or anything else. cat is installed in 100% of all Linux distributions (no matter whether server or desktop version).


That's it folks.
#2
HaHaHa
So good of you !
I remember thinking about how to tackle such a situation in linux. But never got around to trying it. Also from theoretical thinking, I expected there to be more than just the file extensions to determine the order. I thought there would be some special character or codes at the end and start to delimit the main data segments and so I will have to cut those and assemble the rest in order to get to the whole. But now that I think of it, this indeed seems the simplest logical solution.

Thanks for this.

re. now go and find out how to do this segmentation of a big file in linux with some simple tool that does just the opposite of cat at pre specified data limits.
Thanks to cubedata.net and post4vps.com for my awesome vps8.
#3
@rudra

Most likely split can help with that.
split -d --bytes=<size> <input file> <output file prefix>

Size can be specified in K (Kilo), M(Mega) and G (Giga). Like 100M for 100 Megabyte parts.

Split man page: http://man7.org/linux/man-pages/man1/split.1.html
#4
im kinda familiar with the file extension . it was popular before to join it it use program called hjsplit if im not wrong and it have the same file extension so it is related ? . but the hjsplit kinda lost in popularity probably because parted zip and rar is better option but most importantly internet is much faster so there is much less reason to part a file
Terminal
humanpuff69@FPAX:~$ Thanks To Shadow Hosting And Post4VPS for VPS 5
#5
The file extension is being used by quite some applications these days including 7Zip for multi part archives, HJSplit and other applications. While this subject is just about splitting, 7Zip uses the format a bit different as it creates compressed split archives with it.
#6
(03-11-2019, 07:21 PM)Hidden Refuge Wrote:  @rudra

Most likely split can help with that.
split -d --bytes=<size> <input file> <output file prefix>

Size can be specified in K (Kilo), M(Mega) and G (Giga). Like 100M for 100 Megabyte parts.

Split man page: http://man7.org/linux/man-pages/man1/split.1.html


thanks !

Now can 7zip on winfows put them back together ?
That was my intention all along.
Thanks to cubedata.net and post4vps.com for my awesome vps8.
#7
This is quite helpful!
But I never tried it!
Is this like combining several parts of a file that is cropped!
Ask
Thank To Host4Fun And Post4Vps For Exelect VPS
-------------------------------------------------------------------------
Art
#8
I downloaded a random 100 MB file (generated from /dev/random) and split it up into 10 MB parts using this command:
split -d -a 3 --bytes=10M random-100M random-100M.

Result files are:
Quote:random-100M.000
random-100M.001
random-100M.002
random-100M.003
random-100M.004
random-100M.005
random-100M.006
random-100M.007
random-100M.008
random-100M.009

After downloading them to a Windows computer with 7Zip installed I attempted to extract them. As expected 7Zip does recognize the .001 file. However if you noticed the files from the split are starting with .000 to .009. So you cannot extract it because the initial part is not going to be picked up by 7Zip. And I didn't even bother to experiment with renaming.

How to fix this? Simple, instead of -d just use --numeric-suffixes=001 to tell it to start from 001 instead of 000. -a 3 controls how big the suffix is. So a -a 3 equals size a of 000-999. While the default is 2 and would limit it to 00-99.

So the command you would use is:
split --numeric-suffixes=001 -a 3 --bytes=10M random-100M random-100M.

Now the output files start from .001. I downloaded them to the same Windows computer and could extract them just fine Smile .


@chanalku91

It is combining a single file that has been spit into many smaller files. Nothing to do with cropping. You don't/can't crop files. You an crop photos or screenshots or a video but not files.
#9
I'm not much into these things. But I didn't knew it was possible manually too. I thought it can be done via downloaders and compressing extensions. Anyways, great!
+REP.

Sorry for lulposting xd

Premium Web Hosting | ShadowCrypt | ManalShaikh.info Blog
#10
(03-12-2019, 03:36 PM)Manal Wrote:  I thought it can be done via downloaders and compressing extensions.

Not to cause any confusion but actually split doesn't add any compression. It isn't an archive manager. Just really merely a tool to split files into several parts without any kind of compression.
 


Possibly Related Threads...
Thread Author Replies Views Last Post
  Fix Intel GPU Tearing on Linux NomadicSingularityArray 0 122 12-02-2018, 06:35 PM
Last Post: NomadicSingularityArray
  [Tutorial] How to install MTA:SA gameserver in Linux arsalahmed786 3 373 09-20-2018, 04:43 AM
Last Post: Rehan
  How To Install SSH Tunneling Server (Linux And Windows) humanpuff69 11 3,895 07-13-2017, 11:22 AM
Last Post: humanpuff69
  How to add a cool ASCII art to your linux vps when you login to ssh humanpuff69 1 1,360 06-08-2017, 02:36 PM
Last Post: Dynamo
  SOME EVERGREEN USEFUL LINUX COMMANDS sagher 7 1,610 03-19-2017, 04:56 PM
Last Post: sagher

Forum Jump:


Users browsing this thread: 1 Guest(s)

Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - SSDBlaze - VPSlices - Abc-Hosters - Hyper Expert - Shadow Hosting - Bladenode - HostDoc - Hostlease


About Post4VPS

Post4VPS is a forum/destiny where you can Delploy Your Free VPSs just by the Power of Posts.

We Provide VPSs of many locations like Germany,US,Canada,France,London,etc.

We also Provide VPSs of Both Linux and Windows OS.