Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

sed remove line containing

sed '/pattern to match/d' ./infile
Comment

sed remove line containing

sed '/pattern to match/d' ./infile
Comment

delete line in sed

# -i here update the file, try with and without -i, 
sed -i -e '/yourpattern/,$d' file # delete everyhing afer the pattern
sed '/yourpattern/d' file   #delete pattern containing line
sed -i -e "/your_pattern/,+2 d" file  # 2 lines after the pattern
sed -i -e "5,5d" file # remove 5th line
sed '10,$d' pes.com # delete everything after 10th line
sed '7,36!d' tmp.com > tmp_coord # specific lines to a file
sed -i '$d' file # delete last line
sed -i -e '29,36d' pes.com delete specific lines 
sed -i -e '78r../../insert_file' File_you_change.txt   #sed interst lines to a file
sed 's/^........//' delete chars 1st to x in ANY line, ... = charachters 
Comment

delete line in sed

# -i here update the file, try with and without -i, 
sed -i -e '/yourpattern/,$d' file # delete everyhing afer the pattern
sed '/yourpattern/d' file   #delete pattern containing line
sed -i -e "/your_pattern/,+2 d" file  # 2 lines after the pattern
sed -i -e "5,5d" file # remove 5th line
sed '10,$d' pes.com # delete everything after 10th line
sed '7,36!d' tmp.com > tmp_coord # specific lines to a file
sed -i '$d' file # delete last line
sed -i -e '29,36d' pes.com delete specific lines 
sed -i -e '78r../../insert_file' File_you_change.txt   #sed interst lines to a file
sed 's/^........//' delete chars 1st to x in ANY line, ... = charachters 
Comment

sed remove line

$ sed 's|http://||' <<EOL
http://url1.com
http://url2.com
http://url3.com
EOL
Comment

sed remove line

$ sed 's|http://||' <<EOL
http://url1.com
http://url2.com
http://url3.com
EOL
Comment

PREVIOUS NEXT
Code Example
Shell :: windows get hostname from ip 
Shell :: apache2 configtest 
Shell :: apache version mac 
Shell :: install watchman windows 
Shell :: install miniconda on mac 
Shell :: alpine set keyboard layout 
Shell :: get only figures of string bash 
Shell :: copy all files in folder with powershell 
Shell :: how to remove filename too long error in git 
Shell :: tar exclude directory 
Shell :: git remove all tags 
Shell :: docker ps with ip 
Shell :: TypeError: lookups.flatMap is not a function 
Shell :: add user to group 
Shell :: how to use traceroute command in ubuntu 
Shell :: how to make wsl import 
Shell :: find user shell 
Shell :: git init branch name 
Shell :: kube delete cronjob 
Shell :: docker run restart always 
Shell :: git ignore mode 
Shell :: get video codec ffmpeg 
Shell :: ubuntu facial recognition login 
Shell :: .gitignore global 
Shell :: rejected master fetch first 
Shell :: bz2 unzip 
Shell :: chmod 777 recursive all files 
Shell :: bash exit code status last command 
Shell :: terminal delete directory not empty 
Shell :: find folder size in linux 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =