Csplit
| csplit | |
|---|---|
| Operating system | Unix and Unix-like |
| Platform | Cross-platform |
| Type | Command |
| License | GNU GPL v3 |
csplit is a shell command for splitting a file into two or more smaller files determined by context lines. The command is commonly available on Unix and Unix-like operating systems.
The command is part of the X/Open Portability Guide since issue 2 of 1987. It was inherited into the first version of POSIX and the Single Unix Specification.[1] It first appeared in PWB UNIX.[2] The version in GNU coreutils was written by Stuart Kemp and David MacKenzie.[3] The command is available for Windows via UnxUtils.[4]
Usage
The command line arguments consist of options, a file path and a list of patterns.
Each patterns is a line number or regular expression. The program outputs pieces of the file separated by the patterns into files xx00, xx01, etc., and outputs the size of each piece, in bytes, to standard output.
Comparison to split
The split command also splits a file into pieces, although the pieces are of a fixed size, measured in lines or bytes.
See also
References
- ^ – Shell and Utilities Reference, The Single UNIX Specification, Version 5 from The Open Group
- ^ – FreeBSD General Commands Manual
- ^ "Csplit(1) - Linux man page". Archived from the original on 2019-07-31. Retrieved 2019-01-26.
- ^ "Native Win32 ports of some GNU utilities". unxutils.sourceforge.net. Archived from the original on 2006-02-09. Retrieved 2025-08-09.
Further reading
- Ellen Siever, Aaron Weber, Stephen Figgins, Robert Love, Arnold Robbins, et al. Linux in a Nutshell, 5th Edition. O'Reilly Media: July 2005. ISBN 978-0-596-00930-4.
External links
- : split files based on context – Shell and Utilities Reference, The Single UNIX Specification, Version 5 from The Open Group
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.