RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

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

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

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

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
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

Share this linux post:

Submit csplit in Delicious Submit csplit in Digg Submit csplit in FaceBook Submit csplit in Google Bookmarks Submit csplit in Stumbleupon Submit csplit in Technorati Submit csplit in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.


Linux eBooks FREE Download