Identify file type

Consider the following output of the ls -l command:

linux file type codes

Notice the first character in each line of the output (the characters , d, and l). The characters represent the file type. The type determines how Linux will interpret the file – as ordinary data, a directory, or a special file type. For example, if the first character is set to d, Linux will interpret the file as a directory. The hyphen () stands for a normal data file. The character l represents a symbolic link.

Here is a table of all file type codes in Linux:

linux file type codes table

Geek University 2022