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

Anthon
  • 79,293
Nathaniel
  • 430

2 Answers2

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.

Michael Homer
  • 76,565
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 .

SparedWhisle
  • 3,668