How to Can I Remove Specific Line From a File
If you have necessary to find and remove a specific line from am file on Linux system use following different command,
For example the below command remove a line which contain a string,
The below command remove a line which contain a string, with a same file (thelinuxfaq.txt.backup)
Follwoing command just clear a line which contain a string,
This command, find files file names with .txt extension, remove a line which contain a string "linux"
-i (or) --in-place edit files in place
GREP command also help us to remove a line, the below command are grep with -v option invert the sense of matching to select non-matching lines.
Remove a file name which contain a string.
Find the files which contain string name "fedora" and remove that files.