Search code examples
bashgrepls

if i wanted to do ls on files would this suffice?


 ls | grep -v "//|=/|@/||"

will ls then piped to a reverse grep work? This question seems to not meet the quality standards, maybe if i write more random things it will be a quality question.


Solution

  • If you do this you should explicitly add the -F flag.

    ls -F | grep '...'
    

    Using find would be more elegant, in my opinion:

    find . -type f                # Recurse into subdirectories.
    find . -maxdepth 1 -type f    # Do not recurse.