Linux File Basics
Understanding Linux File System
In Linux, files are fundamental components of the operating system. Every piece of data, configuration, or program is represented as a file. Linux follows a hierarchical file system structure, with the root directory /
serving as the top-level directory.
File Types in Linux
Linux supports several file types, each with unique characteristics:
File Type |
Symbol |
Description |
Regular File |
- |
Standard files containing data |
Directory |
d |
Containers for other files and directories |
Symbolic Link |
l |
Pointer to another file or directory |
Block Device |
b |
Hardware devices with block-based access |
Character Device |
c |
Hardware devices with character-based access |
File Permissions
Linux uses a robust permission system to control file access:
graph LR
A[User Permissions] --> B[Read]
A --> C[Write]
A --> D[Execute]
E[Group Permissions] --> B
E --> C
E --> D
F[Others Permissions] --> B
F --> C
F --> D
Permission Representation
r
(Read): View file contents
w
(Write): Modify file contents
x
(Execute): Run executable files
File Naming Conventions
- Case-sensitive file names
- No file extension requirements
- Avoid special characters
- Use lowercase and underscores
Basic File Commands
## List files
ls
## Create directory
mkdir mydirectory
## Change directory
cd /path/to/directory
## Print working directory
pwd
LabEx Tip
When learning Linux file basics, LabEx provides interactive environments to practice file manipulation skills effectively.