Monday, August 1, 2011

How to divide a file in Ubuntu


Although today's email services whenever possible to send larger files, or even always, you can use other services from Dropbox, any other solution, there are moments when you may need to split a file into smaller files.

There are many ways to do it, but probably the quickest and easiest is through the terminal, and is split

Split is a simple command that allows you to split a file into smaller ones. Its use is as simple as:
split [OPTION]... [INPUT [PREFIX]]
The options are:
  • -Suffix-length=N use suffixes of length N (default is 2)
  • -Bytes=SIZE sets the size of split files into SIZE
  • -Line-bytes=SIZE sets a maximum file size divided as SIZE
  • -Numeric-suffixes use numeric suffixes instead of alphabetic
  • -Lines=NUMBER puts the number of lines per file split
  • -Verbose prints a diagnostic after each split file is created
  • -Help show help
  • -Version prints the version of split
The size, SIZE, may be one of the following: KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.

For example:
split --bytes=10M --suffix-length=3 --numeric-suffixes prueba DIV
the file "test" has a size of just over 79 MB or so, with this command will divide in 7 files of 10 MB and one with the rest, which begin with the prefix DIV, and the suffix is numeric and 3 characters length, as you can see in the image below:

Once the files have arrived and you did what you had to do with them, we have to do the reverse: "link" and is a simple operation like the above simply

cat DIV* > prueba
Indeed, there are graphical tools can do wonders when it comes to split a file and then attach it again, however, with this pair of command "split" and "cat", simplicity and speed is absolute. If you're still seems awkward to use split, you can always create an alias for it and simplify it further.
If this article was useful and you want to help us to grow Subscribing to our feed or Click "Like" in our Facebook page ,or follow us via Twitter or subscribing to our feed.

People who read this post also read :


Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More