Jump to content

[SOLVED] piping quirk using "less" command


mikeburns

Recommended Posts

Hello all, I'll get straight to my problem:

 

I typed in

 

ls -al | less

 

obviously to get the directory listing.  Then before I quit the

less

command with

:q

, I pressed ctrl+ins and typed in the command:

 

ls /my/path/ | grep -Pie 'regexp_here'

 

OOPS, I forgot to quit

less

.  So I quit.  But every time I execute ANY piped

grep

command, the results are as follows:

 

# ls /my/path/ | grep -Pie 'regexp_here'

| grep -Pie 'regexp_here'
./results_that_match_regexp
./results_that_match_regexp
./results_that_match_regexp
./results_that_match_regexp
...

 

how can I get rid of this?  I logged out and logged back on, thinking it was tied into my session, and looked through a few files in the /~ directory, but didn't find anything that helped me.

 

I hope I phrased my question properly and gave you a good description of the problem.

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/132736-solved-piping-quirk-using-less-command/
Share on other sites

Ok, I figured it out myelf.  If you press SHIFT+INSERT while "less" is running, then it prompts you for a place to store the log file.  So it acutally created a log file named (ls /path/here/ | grep -Pie 'regexp_here')

 

so that is why the file appeared when I ran the command

 

silly me.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.