Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

split string using linux cmd

$ s='one_two_three_four_five'

$ A="$(cut -d'_' -f2 <<<"$s")"
$ echo "$A"
two

$ B="$(cut -d'_' -f4 <<<"$s")"
$ echo "$B"
four
Comment

split command in linux

Split command in Linux is used to split large files into smaller files. 
It splits the files into 1000 lines per file(by default) and even allows users to change
the number of lines as per requirement.

The names of the files are PREFIXaa, PREFIXab, PREFIXac, and so on. 
By default the PREFIX of files name is x and the default size of each 
split file is 1000 lines per file and both the parameters can be changed with ease.
It is generally used with log and archive files as they are very large 
and have a lot of lines, So in order to break them into small files for analysis
split command is used.

Syntax:

split [options] name_of_file prefix_for_new_files
Comment

PREVIOUS NEXT
Code Example
Shell :: buildozer cython not found 
Shell :: install ddev on linux 
Shell :: ansible tar with a datestamp 
Shell :: remove directiory bash 
Shell :: usermod basic syntax 
Shell :: how to get last folder from path 
Shell :: ibus ubuntu 22.04 not working 
Shell :: rsync id_rsa 
Shell :: git cli 
Shell :: apt install dbreaver 
Shell :: github action and netlify deploy 
Shell :: openra ubuntu 
Shell :: getcap 
Shell :: exporting samtools to path 1.13 
Shell :: android studio git upsh unable to read askpass response 
Shell :: how make unbuntu use llvm-13 
Shell :: which command 
Shell :: git branch description 
Shell :: disable logging in linux 
Shell :: Payload create wireless network association (auto connect) pineapple 
Shell :: smach viewer install 
Shell :: subtract 
Shell :: git add symlink alias link file folder 
Shell :: intellij in ununtu 
Shell :: git annoted tags 
Shell :: install codium Fedora 
Shell :: Authentication required. System policy prevents WiFi scans 
Shell :: find file extension zsh 
Shell :: mongodb install and connect 
Shell :: how to change default directory in linux 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =