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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.