Jul 202011
 

terminal
Original Article by Juan Valencia

Although some file archivers offer us the option of split the files, this can be easily accomplished with two commands: split and cat.

Splitting a file with split

split just needs the size of the parts that we want to create, and the file that we want to split, e.g.:

split -b 1024 file_to_split.bin

If this file is 6 kibibytes long, it will create 6 files of 1 kibibyte each, named xaaxabxacxadxaeand xaf.

Continue reading »

Flattr this!

Feb 172011
 

tux-terminalAmong the commands available from the linux terminal there’s also cut, very useful for processing strings and characters in general.

The cut command is one of the oldest Unix command. That means that it is more then 40 years old. And it shows. It is important to understand that this is a Unix command and behaves in “Unix way”.  For example, it  uses IFS (Input Field Separators) to determine where to split fields.  You can check it with set | grep IFS. You can also set it, for example, to:

IFS=" tn"

The cut command takes a vertical slice of a file, printing only the specified columns or fields. The columns are selected using the standard IFS or one specified. Continue reading »

Flattr this!