w3reference home
Linux Commands Tutorial


Bookmark and Share

split

split [options] [infile [prefix] ] Split infile into equal-sized segments. infile remains unchanged, and the results are written to prefixaa, prefixab, and so on. The default prefix is x, giving the output files xaa, xab, etc. If infile is - or missing, standard input is read. See also csplit.

Options
-a n, --suffix-length=n Use suffixes of length n (default is 2).
-b n[b|k|m] , --bytes=n[b|k|m] Split infile into n-byte segments. Alternate block sizes may be specified:
b : 512 bytes.
k : 1 kilobyte.
m : 1 megabyte.
-C bytes[b|k|m] , --line-bytes=bytes[b|k|m] Put a maximum of bytes into file; insist on adding complete lines.
-d, --numeric-suffixes Use numeric suffixes instead of alphabetic suffixes for the output filenames.
-n, -l n, --lines=n Split infile into n-line segments (default is 1000).
--help Print a help message and then exit.
--verbose Print a message for each output file.
--version Print version information and then exit.

Examples
Break bigfile into 1000-line segments:

split bigfile

Concatenate four files, then split them into 10-line files named new.aa, new.ab, and so on. Note that without the -, new. would be treated as a nonexistent input file:
cat list[1-4] | split -10 - new.


Code Validator
Learn FTP
Color finder
Link Checker
Free web designs
Coming soon!
Interview Questions...
'w3reference : Learn by examples ... Advanced to beginner's tutorials ...'
Ajax: AJAX tutorial1 | Apache: Apache HTTP Server | Restarting Apache | CSS: CSS Border | CSS Syntax | CSS Selector | CSS Comment | CVS: CVS Release | CVS Login | CVS Logout | CVS Annotate | Databases: Rolap Tutorial | OLAP Tutorial | OLTP Tutorial | data warehousing | Expect: HTML: html | Linux: Dot (.) conf files | Linux Mount Point | Linux Filesystem | SSH Tutorial | Linux Commands: cal | cat | cfdisk | chroot | MySQL: MySQL Commands | PHP: PHP Basics | PHP Variables | PHP Output (echo/print) | PHP String Concat | PL/SQL: PL/SQL Data Types | PL/SQL Control Structures | PL/SQL File Extensions | PL/SQL DBMS_OUTPUT package | Python: My first Python program | Shell: Starting Bash | Bash Redirection | Bash Pipes | Bash Variables | SQL: SQL Transactions | SQL Constraints | SQL Drop | SQL Union & Union All | SVN: svn architecture | SVN Repository | SVN Import | SVN Checkout | Tech: soap | Web Designing: Web Hosting | HTML/XHTML/CSS code validator | Learn FTP | Search Engine Optimization Tips | www: XML: XML vs HTML | XML Syntax | XML Tags, Elements and Attributes | XML Namespaces |
Sitemap | Disclaim | Privacy Policy | Contact | ©2007-2009 w3reference.com All Rights Reserved.