The Linux file system is organized in a hierarchical structure, starting from the root directory (/). This structure is different from Windows and provides a more organized way to manage files and directories.
Text files, binary files, images, etc.
ls -l file.txt
Containers for files and other directories
ls -ld directory/
Pointers to other files or directories
ln -s target link_name
Block (b) and Character (c) devices
ls -l /dev/sda
ls -la
List all files including hidden ones with detailed information
cd /path/to/directory
Change to specified directory
pwd
Print working directory (show current location)
mkdir -p /path/to/new/directory
Create nested directories
find / -name "filename" -type f
Search for files by name
Linux uses a robust permission system to control access to files and directories. Each file has three types of permissions:
Permission to view file contents
Permission to modify file contents
Permission to run the file as a program
The user who created the file
chmod u+x file.txt
Users who belong to the file's group
chmod g+w file.txt
All other users on the system
chmod o-r file.txt
chmod 755 myfile.txt
Sets permissions to: Owner (rwx), Group (r-x), Others (r-x)
chmod 644 myfile.txt
Sets permissions to: Owner (rw-), Group (r--), Others (r--)
chmod 777 myfile.txt
Sets permissions to: Owner (rwx), Group (rwx), Others (rwx)