As of May 31, 2023, we have updated our Code of Conduct.

New answers tagged

3 votes
Accepted

How to search for all text lines that start with a tab character?

I need to find all lines in a text file that start with tab. You need to start cmd with the /f:on parameter. This changes the file completion character to ctrlf and frees up tab so you can use it on ...
DavidPostill's user avatar
  • 152k
2 votes

How to search for all text lines that start with a tab character?

For those of us who use Powershell, it can be achieve with the cmdlet: Select-String test.txt -Pattern "^\t.+" This will show the lines and indicates the line number. If you don't want to ...
Reddy Lutonadio's user avatar
0 votes

Vim hiding quickfix column / gutter

you can enable and disable the sign column (aka the gutter), check documentation with :h signcolumn First check your current value so you can reset it after temporarily disabling. Default value is ...
spazm's user avatar
  • 107
0 votes

grep output to file does not work - ping www.google.com |grep -v "time=1." >>ping.log

Change it to: ping www.google.com | grep -v --line-buffered "time=1." >> ping.log --line-buffered will force buffering to be flushed with each line so that you can output them to the ...
Destroy666's user avatar
  • 2,741
9 votes
Accepted

Maven - ignore ANSI color escaping chars in grep search

There's also --batch-mode (-B) for mvn which makes the output more suitable for e.g. CI or searches likes this as it's more automated. Or, a generic solution, strip ANSI colors in any command by using ...
Destroy666's user avatar
  • 2,741
6 votes

Maven - ignore ANSI color escaping chars in grep search

Seems mvn has a config of -Dstyle.color=auto to ignore the ANSI color escaping chars so that I don't need to alter the pattern in my script to add .*. # define an alias including the color settings $ ...
WesternGun's user avatar
1 vote
Accepted

Using grep to search for files with a specific extension

Use --include=\*.cs grep -l -i -r --include=\*.cs "public virtual List<" /mnt/c/mycode/*
L. Scott Johnson's user avatar
8 votes

How to check if a command is running currently?

The common trick to skip the line with the grep itself is to use some kind of a regex: ps aux | grep '[c]url' The commmand itself now doesn't contain the string curl itself, so it won't match.
choroba's user avatar
  • 18.4k
2 votes

How to check if a command is running currently?

One possible way is to add another grep to filter the grep process instead of ps aux | grep curl make it ps aux | grep curl | grep -v grep
Romeo Ninov's user avatar
  • 4,929
11 votes

How to check if a command is running currently?

You can just use pgrep curl, which returns process ID(s) only if a running process is found. Example: [ -n "$(pgrep curl)" ] && echo "yes" || echo "no" pgrep ...
Destroy666's user avatar
  • 2,741
0 votes

gnu grep -r -R -recursive not working on Windows 11

I eventually found an answer to my question. The thing that was needed was a place to start, which I unwisely assumed would be the directory you are in. So, the command would need to look as follows: ...
D. Scruggs's user avatar
3 votes

Does Microsoft word have wildcards for return (\r) & new line (\n) like Grep or Regex do?

In Microsoft Word, you can use wildcards to search and replace formatting characters, including return and newline characters. To do this, follow these steps: Press Ctrl + H to open the Find and ...
solotrek's user avatar

Top 50 recent answers are included