Eric Johnson
Eric Johnson

Reputation: 1165

ls files with associated types

I list contents of pwd

ls

But get a bunch of names. And I don't know which are directories and which aren't.

How do I list out the contents of a folder with each item's associated filetype?

Upvotes: 0

Views: 58

Answers (2)

Emil Hotkowski
Emil Hotkowski

Reputation: 2343

When you use the ls command with the option -l, the first string of letters gives the info about each file, and the first letter in this string gives the file's type. (d = directory, - = standard file, l = link, etc.)

Upvotes: 0

Ren
Ren

Reputation: 2946

You can use

$ ls -F

or

$ ls --file-type

Upvotes: 1

Related Questions