Re: list files but not directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


ann kok wrote:
any way to list files but not directory
Some time ago, there were at least 116 useful combinations of arguments
to ls.
UNIX is 40 years old, and ls was there ...

Whenever this question pops up, and it does quite often, I respond with a question.
"Why do you want to see just files?"
"What file types are you interested in?"

Which usually gets a response like: "How many different file types are there?" for which the answer is: "At least `egrep -v "^#" /usr/share/file/magic | wc -l`" (10179)
There are also some blank lines in the file, but you get the idea.

So now the question is:  "What files types do you want ls to list?"
"Did you try the 'F' argument?"

The 'F' argument to ls will attach a single character to the file name in order to identify what file types they are. Of course, only the common file types can be identified this way -- there are only some 96 displayable characters.
So we are back to the original question:

"What is it you are trying to do?"

The answer to that is very likely different from what you expected.

Good luck!

fedora-list mailing list
[email protected]
To unsubscribe:

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux