Tagged Questions
2
votes
3answers
82 views
Output to stdout and at the same time grep into a file
I have a script that outputs text to stdout. I want to see all this output in my terminal, and at the same time I want to filter some lines and save them in a file. Example:
$ myscript
Line A
Line B
...
2
votes
2answers
80 views
Tail -f piped through grep not outputing to file, but outputs to console
I'm using the following command
tail -f /mydir/myfile | grep "searchterm" >> outfile
Without the '-f' it works fine, but with the '-f', which I need, nothing is written to the file. The ...
1
vote
3answers
137 views
grep how to suppress display of non-matched file?
I am trying to find files containing a specific word using grep. There are many files in the directory (> 500)
Command I run
$ grep 'delete' *
Output
validate_data_stage1:0
validate_data_stage2:0
...
1
vote
5answers
594 views
Display output to console while grep is used
In vim I use the following command to compile a tex file:
pdflatex\ \-file\-line\-error\ \-shell\-escape\ \-interaction=nonstopmode\ $*\\\|\ grep\ \-P\ ':\\d{1,5}:\ '
this works in terms of getting ...
0
votes
1answer
140 views
Printing file content with grep
Is it possible to print to the console all file content using only grep command? (wihtout cat, less, echo, more...)