In linux, I have a files contains, amongst other, lots of files and directories containing the literal "scrap".
I can see them by typing ls *scrap*
without problem. However that returns also directories containing the literal "scrap" and i would like to exclude those.
I tried playing around with ls | grep ".*scrap.*"
or ls | grep scrap
but this returns only the directories (not the normal files).
Why is this so?
The next step will be (once the rep returns the correct output) to remove the directories from that output. Suggestions on how to do that are also welcomed!