Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
fuss:grep [2013/10/19 06:09] – created officefuss:grep [2022/04/19 08:28] (current) – external edit 127.0.0.1
Line 1: Line 1:
-===== Set Intersection / Set Subtraction =====+====== Set Intersection / Set Subtraction ======
  
 To find lines that are in both of two files (intersection) or in only one of the two files (subtraction), use the following commands: To find lines that are in both of two files (intersection) or in only one of the two files (subtraction), use the following commands:
Line 10: Line 10:
 grep -vxF -f file1 file2 grep -vxF -f file1 file2
 </code> </code>
 +
 +====== Trim Commented and Blank Lines ======
 +
 +Many Linux configuration files use the hash sign (''#'') as a comment indicator. The following command:
 +<code bash>
 +grep -v -e "^#" -e "^$" /etc/squid3/squid.conf
 +</code>
 +
 +will remove (''-v'') all the lines starting with comments (''^#'') and then additionally will remove blank lines left after the trim (''^$'') from the file ''/etc/squid3/squid.conf''.
  

fuss/grep.1382162946.txt.bz2 · Last modified: 2014/12/19 22:48 (external edit)

Wizardry and Steamworks

© 2025 Wizardry and Steamworks

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.