feed-image  ISSN 1836-5930



Receive Your Complimentary Guide to Linux NOW!


A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)




Poll

Do you care about your privacy when using a FACEBOOK?
 

linuxconfig.org
is hosted by:



Partner Linux Sites
TuxMachines
DebianAdmin
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
FreeSoftwareLinux
All For Linux

csplit
Article Index
1. Name
2. Synopsis
3. Frequently used options
4. Examples

1. Name

csplit [man page] - split a file into sections determined by context lines

2. Synopsis

csplit [OPTION]... FILE PATTERN... 

3. Frequently used options

-f, --prefix=PREFIX
use PREFIX instead of `xx'
-k, --keep-files
do not remove output files on errors
-s, --quiet, --silent
do not print counts of output file sizes

4. Examples

Lets create sample file:
echo "This project's objective is not to compete with
The Linux Documentation Project , but to serve as a free
exchange reference guide for both new and established
Linux users. Visitors are encouraged to not only use the
information that is presented on this website, but to
also share any additional information that they feel will
assist other viewers. It's main purpose is to provide
viewers of all levels access to informative methods on
how to configure the Linux Operating System without having
to read large amounts of documentation." > commands.txt
Split file up to 10 parts each with one line:
csplit -k -s commands.txt 1 {10} 
Split file up to 10 parts
Do the same as above but with a prefix option:
csplit -k -s --prefix=linuxconfig.org commands.txt 1 {10} 
Split file up to 10 parts with prefix