split a file into pieces
[OPTION]... [INPUT [PREFIX]]
add an example, a script, a trick and tips
Tool like Media File Segmenter for Linux
Try ffmpeg. It's
powerful & cross-platform. It may already exist in your linux
distro. To copy 2 minutes of video after the first and convert
from mpg to ts:
ffmpeg -vcodec copy -ss 00:01:00 -t 00:03:00 \
-i input.mpg -vcodec copy -acodec copy \
-f mpegts output.ts
It's a good choice if you have lots of videos in essentially
random formats. It's a 'swiss army knife' for video.
If you are starting with mpeg, you could also try mpegtx, which
includes a variety of mpeg tools including a splitter. Easier
IMHO than ffmpeg to split. To split a file into 10 chunks each
with a basename of 'chunk':
mpgtx -10 input.mpg -b chunk
You may also be able to use VLC as a
splitter, but I never have. There are topics discussing it, however.
Concatenate files over FTP
Unless you've got remote desktop access to the FTP server and can
open a session thru Remote Desktop and launch a concatenation
program on the server, then the answer is no : the ftp servers I
know don't allow remote execution and don't do concatenation.
I'm afraid you'll need to re-upload the unsplit file.
I would also like to add that uploading thru multiple connections
doesn't improve the upload time, which stays always limited by
your bandwidth. For example, if your upload bandwidth is 20k,
then one connection will upload at the speed of 20k, while two
connections will upload at the speed of 2X10k=20k. Total gain is
then zero. When uploading a large file, it's important to use an
FTP client that supports resumes, so in case of disconnection the
data already uploaded is not lost and you can later restart from
where you stopped.
Is there a way to reassemble files split without enumerating all of the parts explicitly?
This is what wildcards and brace expansion are for. See if
echo file.bz2.part-* returns the filenames in the
desired order, and use
cat file.bz2.part-* >
file.bz2 if it does. Otherwise, figure out some other more
complex expansion that does.
How to split big flac file int tracks and fill the id3 tag?
Install reaquired packages on Debian (Ubuntu):
sudo apt-get install cuetools shntool flac
Split flac file and fill id3 tags:
cuebreakpoints sample.cue | shnsplit -o flac sample.flac
cuetag sample.cue split-track*.flac
Some systems has cuetag.sh instead of
How do I split a lubuntu root partition?
You can use a tool like GParted to resize your current partition so
that it is smaller. After you resize and made some free space,
you can create additional partitions in the free space. Make sure
you make a backup before you commit to any partition changes.
Note: some distro installers also come with tools to resize
partitions, so you may be able to do it as you install another
split files on windows compatible with linux cat
- install 7z (free) works for Windows and Linux. Use the -v
option (volume) -v100m will split the archive into 100MB files.
7z -v option supports b k m g (bytes, kilobytes, megabytes,
upoad files and extract them from Linux
How do I split files in place (delete original as new files are written)
I don't think this is possible because a file takes one or
several blocks, so if you want to split not at the block
boundary, you will need to move the rest of the file so that it
starts at the beginning of a block.
However, you can use
dd to read a section of a
file - to archive or examine.
How to split a video file into smaller chunks in Linux?
Use split tool available for all UNIX-like systems. For
example, to split a file in 100 MiB chunks.
split â€“bytes=100m /path/to/large/file /path/to/output/file/prefix
Refer to the manual for more information (man
how to recover data splitted by split command
cat partaa partab partac > file
fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...;
default size is 1000 lines, and default PREFIX is
’x’. With no INPUT, or when INPUT is -,
read standard input.
arguments to long options are mandatory for short options
generate suffixes of length N
append an additional SUFFIX to
put SIZE bytes per output
put at most SIZE bytes of lines
per output file
use numeric suffixes instead of
alphabetic. FROM changes the start value (default 0).
do not generate empty output
files with ’-n’
write to shell COMMAND; file
name is $FILE
put NUMBER lines per output
generate CHUNKS output files.
immediately copy input to
output with ’-n r/...’
print a diagnostic just before
each output file is opened
display this help and exit
output version information and
SIZE is an
integer and optional unit (example: 10M is 10*1024*1024).
Units are K, M, G, T, P, E, Z, Y (powers of 1024) or KB, MB,
... (powers of 1000).
CHUNKS may be:
N split into N files based on size of input K/N output Kth
of N to stdout l/N split into N files without splitting
lines l/K/N output Kth of N to stdout without splitting
lines r/N like ’l’ but use round robin
distribution r/K/N likewise but only output Kth of N to
Copyright © 2012 Free Software Foundation, Inc. License
GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute
it. There is NO WARRANTY, to the extent permitted by law.
Report split bugs to bug-coreutils[:at:]gnu[:dot:]org
GNU coreutils home page:
General help using GNU software:
Report split translation bugs to
documentation for split is maintained as a Texinfo
manual. If the info and split programs are
properly installed at your site, the command
coreutils 'split invocation'
should give you
access to the complete manual.
Torbjorn Granlund and Richard M. Stallman.