Search code examples
linuxunixgrepsolarisls

when piped with ls, grep command is not working in solaris


I am using the below command in solaris

ls -l | grep '*PROC*'

But it is not working. I have many files that contain "PROC" in their name like XREF_PROC.complete but when I use the above command its not showing any output. When I use ls *PROC* its working but not working with grep.

Thanks


Solution

  • What you wrote is "get all lines containing * character, then containing PRO string and zero or more C letters. Try this

    ls -l | grep PROC