<aside> 📣

The contents of this notes have been replicated to the following GitHub Repo. Please use the repo instead as it’s meant to be more upto-date than this notes!

https://github.com/Shathin/iiitb_mtech/blob/main/linux_shell_scripting/README.md

</aside>


<aside> 📌 Linux considers every thing as a file.

</aside>

There's three main classifications of files in Linux / Unix:

  1. Regular Files
  2. Directory Files
  3. Special Files.

Special Files further have 5 subcategories.

<aside> 💡 The ls -l command can be used to identify a file type. Check it out here.

</aside>


Inode

Before moving onto files we'll learn about Inodes.

The inode is a data structure in a Unix-style file system which describes a filesystem object such as a file or a directory. Each inode stores the attributes and disk block location(s) of the object’s data.

Filesystem object attributes may include metadata (times of last change, access, modification), as well as owner and permission data.

<aside> 💡 Use ls -i to get the inode number.

</aside>


Regular Files

Examples of regular files are - readable files, binary files, image files, compressed files, etc.

These files are indicated with - (in the first column) in ls -l command output.

<aside> 💡 Use a combination of grep and ls -l to list regular files : ls -l | grep ^-

</aside>