Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

linux remove lines from one file in another

If the files are sorted:

comm -23 file1 file2

-23 suppresses the lines that are in both files, or only in file 2. 
If the files are not sorted, pipe them through sort first...

Comment

delete lines text file linux

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

linux remove lines from file

grep -v "pattern" file > temp && mv temp file
Comment

linux remove lines from file

> sed '2,4d' file
Comment

PREVIOUS NEXT
Code Example
Shell :: créer un fichier powershell 
Shell :: what is appmenu-gtk-module 
Shell :: fullchain.pem privkey.pem 
Shell :: clang format linux 
Shell :: open download folder in mac 
Shell :: bash single bracket and double square bracket 
Shell :: awk rows count 
Shell :: hyper-v powershell add scsi DVD 
Shell :: Linux using GitHub 
Shell :: .net core upgrade 
Shell :: install magento extension composer 
Shell :: docker run -d bash command not found 
Shell :: mac terminal command suggestion history 
Shell :: git rebase branch to master 
Shell :: linux updates popos 
Shell :: gitlab download 
Shell :: Guthub Funding.yml 
Shell :: fetch all from remote 
Shell :: revert uncommitted changes git 
Shell :: send file to remote computer linux 
Shell :: typescript compile specific file 
Shell :: how to remove directory in linux 
Shell :: turn off wiregurad 
Shell :: Jupyter %%time 
Shell :: how to checkout a remote branch in git 
Shell :: add ssh public key to server 
Shell :: how to ignore .idea folder in gitignore 
Shell :: How To Move Folder Using Batch Script 
Shell :: spoof commit date 
Shell :: git clone with subdirectories 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =