Get full Access to Website Content, WebShark packet capture tool and Proximity Download. Purchase
⛶ Night Mode

Linux Files

In Linux system, everything is a file and if it is not a file, it is a process. A file does include text files, images, compiled programs, partitions, hardware device drivers and directories. Linux consider everything as as file.


Linux Files


In Linux, everything is considered as a file. This includes directories, devices, and even programs. There are 7 standard file types in Linux:

  • Regular file: This is the most common type of file. It contains data, such as text, images, or programs.
  • Directory: A directory is a file that contains other files and directories. It is used to organize files and make them easier to find.
  • Symbolic link: A symbolic link is a file that points to another file. It is often used to create shortcuts to files.
  • FIFO special file: A FIFO special file is a pipe that allows two processes to communicate with each other.
  • Block special file: A block special file represents a device that can store data, such as a hard drive or a CD-ROM drive.
  • Character special file: A character special file represents a device that can transmit data, such as a keyboard or a mouse.
  • Socket file: A socket file is a communication endpoint between two processes. It is used to create network connections.

The file type of a file is determined by its inode. The inode is a data structure that stores information about the file, such as its name, size, and permissions.

You can use the ls command to list the files in a directory. The ls command has many options that can be used to display different information about the files. For example, the -l option displays the long listing format, which shows the file type, permissions, size, and date and time of the file.

You can use the file command to determine the file type of a file. The file command takes the name of the file as its argument and displays the file type.

Files are always case sensitive

Let’s understand it through an example.

linux files are case sensitive

In above example, we have two files named as ‘Demo.txt’ and ‘demo.txt’. Although, they both share the same name but still they are two different files.

Linux File Commands

CommandDescription
fileDetermines file type.
touchUsed to create a file.
rmTo remove a file.
cpTo copy a file.
mvTo rename or to move a file.
rename To rename file.