I have a file with a line:
"H:\Check\WP_20140511_029.mp4"
along with other lines. I want to remove such lines indicating the directory in H:\Check. I tried
H:\Check
grep -v ".*H:\\Check.*" testout.txt > testout2.txt
But he did not delete these lines. What is wrong with my regular expression .*H:\\Check.*. regex101 shows that my regex matches the string correctly.
.*H:\\Check.*
You can use:
grep -v 'H:\\Check' testout.txt > testout2.txt
It is important to use single quotes to avoid over-escaping the backslash.
Using the equivalent double-quoted command will be as follows:
grep -v "H:\\\Check" testout.txt > testout2.txt
EDIT:
\\ - , . echo :
\\
echo
echo "H:\\Check" H:\Check echo 'H:\\Check' H:\\Check
-, grep - . * . Grep ( grepping , , , Hi there .*he.*, )
Hi there
.*he.*
( , anubhava , ), - .
, , , H:\\Check.
H:\\Check
( ), , C ( , ), , .
(, , , , , ), 4 . , , , - , 2, grep, .
, , , , - ( , ), .
: , . * .
Source: https://habr.com/ru/post/1677391/More articles:Adding a constant column for sparking - apache-sparkRestore entire bucket - google-cloud-storageHow to replace the default Azure 403 error page - certificateDo any functions in the R-language, except for the functions of "parsing", from string vectors? - securitystdio to terminal ΠΏΠΎΡΠ»Π΅ Π·Π°ΠΊΡΡΡΠΈΡ (STDOUT_FILENO) - cHow to use .babelrc to download babel-plugin-import for antd? - babeljsHow to enable GC server in .NET Core? - garbage-collectionHow to get antd to work with an application created using create-react-app? - create-react-appGlassFish 4.1.2 updatetool / pkg tools crash - missing pkg-bootstrap - glassfish-4.1https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1677396/how-to-map-ffmpeg-formats-to-mime-types-and-file-extensions&usg=ALkJrhjYaHGTfl-RnuUrRFWWKLhAB-ZjmQAll Articles