0

Following on from my previous question I tried to run ls -l; and grep html; which did what I wanted however the command didn't exit back to the prompt. Instead it appeared to be waiting for something else to happen and I had to Ctrl+C to end the process.

Can anyone explain why this happened and what the correct syntax for my command would be?

What I'm trying to do is have grep filter the output of the ls -l

  • What were you trying to do? – Michael Homer Apr 21 '16 at 5:36
  • really what you should do is ls -l *html* – glenn jackman Apr 21 '16 at 13:53
4

You probably wanted to pipe ls -l into grep, for which fish uses a pipe character the same as other shells (for once):

ls -l | grep html

This is the same thing you would have written in Bash. Otherwise, grep is filtering your input from the terminal instead.

| improve this answer | |
2

Seems you didn't give grep a filename. syntax to use grep should be:

grep PATTERN [file] 

if you don't give it a file, it waits for your input .

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.