csplit command in Linux with examples Read Courses Practice Improve Improve Improve Like Article Like Save Article Save Report issue Report The csplit command is used to split any file into many parts as required by the user. The parts are determined by context lines. Output pieces of FILE separated by PATTERN(s) to files ‘xx00’, ‘xx01’, …, and output byte counts of each piece to standard output. Syntax: csplit [OPTION]âĶ FILE PATTERNâĶ Example: Consider a text file named list.txt with contents as follows: Now split this file into two parts (second part starting from 3rd line) using csplit command as follows: Options: -f, –Prefix: It use PREFIX in place of ‘xx’. Example: Here instead of ‘xx’ prefix ‘abc was used. -k, –Keep files: This option will not remove the output files on errors. Example: This command removes all output files in case it encounters an error. This can be changed by using ‘-k’ option. -n, –Digits: Use given number of digits instead of 2. Example: Here we fixed number of digits after the file name. So instead of ‘xx01‘ we get ‘xx0‘. -z, –elide-empty-files: Remove empty output files. Example: This removed the empty output files. -s, –quiet: Does not display counts of output file sizes. -b, –Suffix-format: Use sprintf FORMAT instead of %02d. –help: To show the help message and exit. –version: Display the version information and exit. Learn to code easily with our course Coding for Everyone. This course is accessible and designed for everyone, even if you're new to coding. Start today and join millions on a journey to improve your skills!Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now! Commit to GfG's Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore. Last Updated : 15 May, 2019 Like Article Save Article Previous 'crontab' in Linux with Examples Next ctags command in Linux with examples Share your thoughts in the comments Add Your Comment Please Login to comment...