Using ls command to show file type.

The Linux operating system
using the file type to identify and check its file format. The simple way
to check the file type of any files on Linux system is using the ls command
and file command. The example below demonstrate the use of the ls command
and the file command to identify Linux file type.

Note: On the file permission section,
the first character indicates the file type:

- <= Linux regular file

d <= Linux directory

b <= Linux block special file

c <= Linux character special file

l <= Linux symbolic link

p <= Linux named pipe

s <= Linux domain socket

The ls command with -l option as show
the file in long list format including the file type, file permission and other
Linux file properties as show on Linux command example below:

[root@fedora
~]# pwd

/root

[root@fedora
~]# ls -l install.log

-rw-r--r-- 1 root root 72032 2008-05-20
08:25 install.log

[root@fedora
~]#

ls command output:

Example on using ls command to display
the block special file:

[root@fedora
~]# ls -l /dev/sda

brw-r----- 1 root disk 8, 0 2008-10-30
02:28 /dev/sda

[root@fedora
~]#

ls command output:

Using the file command to find Linux
file type.

The Linux file command usually use to
find out the Linux file type. The file command example below demonstrate the
use of Linux file command to show the type of Linux file on Linux Fedora 9 machine.