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

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 :: ssh save password 
Shell :: unix change timestamp of file 
Shell :: extract tar.xz linux 
Shell :: conda install keyboard 
Shell :: add extra cygwin packages 
Shell :: ssh copy folder from local to remote 
Shell :: zsh list environment variables 
Shell :: assign contents of file to variable bash 
Shell :: how to change permissions for only the root 
Shell :: terminal git add ssh key 
Shell :: mac flutter sdk path 
Shell :: windows print environment variable powershell 
Shell :: powershell set variable 
Shell :: nodemon use 
Shell :: pod upgrade 
Shell :: bash shell remove recursive folder file rm dir 
Shell :: random color npm 
Shell :: change git username and email 
Shell :: whatsapp for linux 
Shell :: gcloud check region 
Shell :: bash find file in directory 
Shell :: download entire website Linux terminal 
Shell :: git diff two commits one file 
Shell :: command to find a file or directory in the current directory 
Shell :: warning: LF will be replaced by CRLF 
Shell :: git exclude some files from git commit 
Shell :: .local ubuntu 
Shell :: compress a folder in ubuntu 
Shell :: how to run script in linux at startup 
Shell :: git remove files from old commits 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =