Linux Commands Examples

A great documentation place for Linux commands

split

split a file into pieces

Synopsis

split [OPTION]... [INPUT [PREFIX]]


add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!

examples

0
source

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.

0
source

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.

0
source

Split PDF document from command line in Linux?

I'll put this as an answer, so as not to clog the question: here is a related link on unix.se:

... and the accepted answer uses a Python script with PyPDF (but that answer implements a split of one page into two - and that script thus needs to be modified for page ranges, for it to work as asked in OP).

 

EDIT: I just found this: Stapler - A python utility for manipulating PDF docs based on pypdf (Page 3) / Community Contributions / Arch Linux Forums; which is, apparently "A small utility making use of the pypdf library to provide a (somewhat) lighter alternative to pdftk" (note that the mailing list notes some problems with it, however)...

0
source

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.

0
source

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 cuetag.

0
source

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 distro.

0
source

split files on windows compatible with linux cat

or

  • 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, gigabytes)

upoad files and extract them from Linux

0
source

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.

0
source

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 split)

0
source

how to recover data splitted by split command

cat.

cat partaa partab partac > file

description

Output 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.

Mandatory arguments to long options are mandatory for short options too.
-a
, --suffix-length=N

generate suffixes of length N (default 2)

--additional-suffix=SUFFIX

append an additional SUFFIX to file names.

-b, --bytes=SIZE

put SIZE bytes per output file

-C, --line-bytes=SIZE

put at most SIZE bytes of lines per output file

-d, --numeric-suffixes[=FROM]

use numeric suffixes instead of alphabetic. FROM changes the start value (default 0).

-e, --elide-empty-files

do not generate empty output files with ’-n’

--filter=COMMAND

write to shell COMMAND; file name is $FILE

-l, --lines=NUMBER

put NUMBER lines per output file

-n, --number=CHUNKS

generate CHUNKS output files. See below

-u, --unbuffered

immediately copy input to output with ’-n r/...’

--verbose

print a diagnostic just before each output file is opened

--help

display this help and exit

--version

output version information and exit

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 stdout

copyright

Copyright © 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

reporting bugs

Report split bugs to bug-coreutils[:at:]gnu[:dot:]org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
Report split translation bugs to <http://translationproject.org/team/>


see also

The full documentation for split is maintained as a Texinfo manual. If the info and split programs are properly installed at your site, the command

info coreutils 'split invocation'

should give you access to the complete manual.


author

Written by Torbjorn Granlund and Richard M. Stallman.

How can this site be more helpful to YOU ?


give  feedback