The split command in Linux (split) is used to split large files into smaller n-files. The output files are generated according to the number of lines in the input file. The default is to split the file every 1000 lines. The names of the output files follow the standard file aa files ab file ac, and so on. You can specify a suffix for the output file.
The most common option is:
In this example, the grocery list file is divided into 4 files with the suffix “list” with two lines each:
$ split -2 supermarket list
$ ls -l
-rw-rw-r-- 1 ec2-user ec2-user 14 Sep 13 09:08 listaaa
-rw-rw-r-- 1 ec2-user ec2-user ec2-user 13 Sep 13 09:08 listaab
-rw-rw-r-- 1 ec2-user ec2-user 14 Sep 13 09:08 listaac
-rw-rw-r -- 1 ec2-user ec2-user Sep 12 13 09:08 listaad
-rw-rw-r– 1 ec2-user ec2-user ec2-user 53 Sep 13 08:40 supermarket
The sudo command on Linux executes a given command as if it were another user.…
The ss command on Linux is extremely useful for investigating sockets, providing various information about…
Free Linux command shows the amount of total memory in use and available, as well…
The shell has structures for testing conditions and executing certain program sequences several times (loop),…
The /etc/fstab file stores the configuration of which devices should be mounted and what is…
The Netcat Command in Linux or nc is a utility used to do “almost anything”…
This website uses cookies.