Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

shell script delete line containing

awk !/searchterm/ ~/.filename > temp && mv temp ~/.filename
That will replace any line containing "searchterm" in the file "filename"

Example:
Input:
	echo "Hello World"
    echo "Goodbye World"
    echo "Hi Developers"
    
Output:
	awk !/Hello/ ~/.greetings > temp && mv temp ~/.greetings
    	echo "Goodbye World"
        echo "Hi Developers"
    
    awk !/world/ ~/.script > temp && mv temp ~/.script
    	echo "Hi Developers"
Comment

PREVIOUS NEXT
Code Example
Shell :: how to logout in linux kali 
Shell :: volver a commit anterior temporal 
Shell :: how to rename many files at once linux 
Shell :: remove a package ubuntu 
Shell :: git: delete branch in local and on remote 
Shell :: git push ci skip 
Shell :: git view differences between commits 
Shell :: remove all untracked files git 
Shell :: brave browser ubuntu 20.10 command line download 
Shell :: install yarn 
Shell :: how to docker login with gitlab 
Shell :: use touch id to sudo 
Shell :: git clone specific branch 
Shell :: remove folder ubuntu 
Shell :: fish alias 
Shell :: git push with gpg key 
Shell :: install composer by cmd 
Shell :: total disk space in linux 
Shell :: linux change azert 
Shell :: git push u origin master 
Shell :: stop nginx server 
Shell :: how to install brew on mac 
Shell :: ubuntu taskbar center 
Shell :: install latest angular cli 
Shell :: how to create bootable usb on manjaro 
Shell :: run application as administrator with powershell 
Shell :: How do I sync local and remote branches? 
Shell :: refresh prometheus configuration 
Shell :: django install pathlib 
Shell :: What is the difference between git push origin and git push origin master 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =