Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Sunday, March 6, 2022

sed command example

 https://stackoverflow.com/questions/71318743/kubectl-versions-error-exec-plugin-is-configured-to-use-api-version-client-auth

Below command will take a backup of the file and substitute v1alpha1 with v1beta1

sed -i .bak -e 's/v1alpha1/v1beta1/' ~/.kube/config


Friday, July 10, 2020

Linux - Splitting & Joining a file

https://www.ibm.com/support/pages/how-use-split-and-cat-commands-split-large-file-smaller-pieces-and-then-restore-pieces-single-file

Splitting:
split -l 1000000 full_file.dat

Output is - xaa, xab, xac

Joining:
cat xab >> xaa
cat xac >> xaa

Note: At the lines where the files are joining, the ending line of part1 and 1st line of part 2 will be concatenated on the same line. We'll have to open the file in vi and just enter a newline in those places.

Followers

Blog Archive