added lpic

This commit is contained in:
2025-05-28 20:18:02 +03:30
parent 4ef37b9655
commit d761d87e16
2 changed files with 118 additions and 0 deletions

59
Linux/LPIC1/directorys.md Normal file
View File

@@ -0,0 +1,59 @@
# 📁 Linux Directory Structure & Basic Commands
This document provides an overview of important Linux directories, their types, and essential file management commands.
---
## 📂 Directory Types
| Type | Description |
| ----------- | ----------------------------------------------------------------------------------- |
| **Virtual** | Do not reside on disk; dynamically generated by the system (e.g., `/proc`, `/sys`). |
| **Normal** | Standard directories that store files and data on disk. |
---
## 🗂️ Common Linux Directories
| Directory | Type | Description |
| --------- | ------- | ----------------------------------------------------------- |
| `/etc` | Normal | System configuration files |
| `/opt` | Normal | Optional or third-party software packages |
| `/bin` | Normal | Essential binary executables for all users |
| `/sbin` | Normal | System binaries, typically for administrative tasks |
| `/lib` | Normal | Shared libraries and kernel modules |
| `/home` | Normal | User home directories |
| `/proc` | Virtual | Kernel and process information (virtual files) |
| `/srv` | Normal | Data for services provided by the system (e.g., web, FTP) |
| `/sys` | Virtual | Kernel devices and system information |
| `/usr` | Normal | Secondary hierarchy: programs, libraries, and documentation |
| `/var` | Normal | Variable data: logs, mail, print spool, temporary files |
| `/dev` | Virtual | Device files (e.g., disk, USB, terminals) |
| `/mnt` | Normal | Mount point for temporary filesystems |
| `/boot` | Normal | Boot loader files, kernel images |
---
## 🛠️ Basic File & Directory Commands
| Command | Description |
| ------- | ---------------------------------------- |
| `cd` | Change directory |
| `ls` | List directory contents |
| `rm` | Remove files or directories |
| `mkdir` | Create a new directory |
| `touch` | Create an empty file or update timestamp |
| `cp` | Copy files or directories |
| `mv` | Move or rename files or directories |
### 📘 Examples
```bash
cd /etc # Navigate to /etc directory
ls -l # List files in long format
rm file.txt # Delete file.txt
mkdir new_folder # Create a directory named 'new_folder'
touch file.txt # Create a new empty file
cp file1.txt file2.txt # Copy file1.txt to file2.txt
mv file.txt /home/user/ # Move file.txt to another directory
```

59
Linux/LPIC1/runlevels.md Normal file
View File

@@ -0,0 +1,59 @@
# Linux Runlevels Guide
This document outlines the standard runlevels for **Red Hat** and **Debian**-based systems. Runlevels are used by `init` systems to define different states or modes of operation for the system.
---
## 📊 Runlevels Overview
| Runlevel | Description | Red Hat | Debian |
| -------- | ------------------------------------ | ------------ | --------------- |
| 0 | Halt | ✅ Supported | ✅ Supported |
| 1 | Single User Mode | ✅ Supported | ✅ Supported |
| 2 | Multi-user (No Network) | ❌ (HaveNet) | ✅ Supported |
| 3 | Multi-user (Network, No GUI) | ✅ Supported | ✅ Supported |
| 4 | Custom/User Defined | ✅ Supported | ✅ Supported |
| 5 | Multi-user (GUI Mode) / Halt *(err)* | ❌ (GUI Mode) | ❌ (Halt/Error?) |
| 6 | Reboot | ✅ Supported | ✅ Supported |
> 💡 **Note**:
>
> * On **Red Hat**, runlevel 5 typically starts the system with a graphical user interface (GUI).
> * On **Debian**, runlevel 5 is often unused or reserved for custom setups.
> * Runlevel behavior can be customized depending on system configuration.
---
## 🔧 Commands
### Check Current Runlevel
```bash
runlevel
```
### Change Runlevel
```bash
telinit <runlevel>
```
or
```bash
init <runlevel>
```
> ⚠️ Changing runlevels may stop or restart services. Use with caution, especially on production systems.
---
## 📚 Additional Tips
* Modern Linux systems (especially systemd-based) may not rely on traditional runlevels. Instead, they use *targets*. Example:
```bash
systemctl get-default
systemctl isolate graphical.target
```