Skip to content

Commit c8b4763

Browse files
committed
Update linux roadmap content
1 parent 9de76da commit c8b4763

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+37
-600
lines changed
Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
11
# Adding Disks
22

3-
Adding disks in Linux involves partitioning, creating filesystems, and mounting. Use `lsblk` to list devices, `fdisk /dev/sdX` to create partitions, `mkfs.ext4 /dev/sdX1` to create filesystems, and `mount /dev/sdX1 /mount/point` to mount. This process prepares new storage devices for seamless integration into the Linux filesystem hierarchy.
4-
5-
The following are common commands to manage disks:
6-
7-
- Use `lsblk` to list all block devices (disk and partitions).
8-
- Use `fdisk /dev/sdX` to create a new partition on a disk.
9-
- Use `mkfs.ext4 /dev/sdX1` to create a new filesystem on a partition.
10-
- Use `mount /dev/sdX1 /mount/point` to mount a filesystem to a directory.
11-
12-
```shell
13-
# example commands to add new disk
14-
lsblk # list all disks and partitions
15-
sudo fdisk /dev/sdb # let's suppose new disk is /dev/sdb
16-
sudo mkfs.ext4 /dev/sdb1 # make filesystem(e.g., ext4) on partition 1
17-
sudo mount /dev/sdb1 /mnt # mount new filesystem to /mnt directory
18-
```
19-
20-
Remember to replace `/dev/sdb` and `/dev/sdb1` with your actual disk and partition identifiers. The mount point `/mnt` may also be replaced with any other directory as per your system's structure and preference.
3+
Adding disks in Linux involves partitioning, creating filesystems, and mounting. Use `lsblk` to list devices, `fdisk /dev/sdX` to create partitions, `mkfs.ext4 /dev/sdX1` to create filesystems, and `mount /dev/sdX1 /mount/point` to mount. This process prepares new storage devices for seamless integration into the Linux filesystem hierarchy.

src/data/roadmaps/linux/content/[email protected]

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,3 @@
22

33
Evaluating available memory is crucial for Linux system health monitoring. Use command-line tools like `free`, `vmstat`, and `top` to track memory usage and performance metrics. The `free -h` command shows total, used, free, shared, buffer/cache, and available memory in human-readable format. Essential for maintaining optimal server performance and troubleshooting resource issues.
44

5-
The `free` command, for instance, gives a summary of the overall memory usage including total used and free memory, swap memory and buffer/cache memory. Here's an example:
6-
7-
```bash
8-
$ free -h
9-
total used free shared buff/cache available
10-
Mem: 15Gi 10Gi 256Mi 690Mi 5.3Gi 4.2Gi
11-
Swap: 8.0Gi 1.3Gi 6.7Gi
12-
```
13-
14-
In this output, the '-h' option is used to present the results in a human-readable format. Understanding the state of memory usage in your Linux server can help maintain optimal server performance and troubleshoot any potential issues.

src/data/roadmaps/linux/content/boot-loaders@o5lSQFW-V_PqndGqo1mp3.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22

33
Boot loaders load the OS kernel into memory when systems start. Common Linux boot loaders include GRUB (modern, feature-rich with graphical interface) and LILO (older, broader hardware support). Boot loaders initialize hardware, load drivers, start schedulers, and execute init processes. Use `sudo update-grub` to update GRUB configuration. Enable multi-OS booting on single machines.
44

5-
```bash
6-
# This command updates the GRUB bootloader
7-
sudo update-grub
8-
```
9-
10-
Irrespective of the type of Boot Loader used, understanding and configuring them properly is essential for maintaining an efficient, stable and secure operating system. Boot loaders also allow users to switch between different operating systems on the same machine, if required.
11-
125
Visit the following resources to learn more:
136
- [@article@comprehensive documentation of Bootloader - archlinux wiki](https://wiki.archlinux.org/title/Arch_boot_process#Boot_loader)
147
- [@article@What Is GRUB Bootloader in Linux?](https://phoenixnap.com/kb/what-is-grub)
Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
11
# Booting Linux
22

3-
Linux booting involves several stages: POST, MBR, GRUB, Kernel, Init, and GUI/CLI. The bootloader loads the kernel into memory, which detects hardware, loads drivers, mounts filesystems, starts system processes, and presents login prompts. GRUB configuration is managed through `/etc/default/grub` with settings like timeout and default boot options.
4-
5-
Here is an example of the GRUB configuration file `/etc/default/grub` which is used to configure the GRUB bootloader options:
6-
7-
```bash
8-
GRUB_DEFAULT=0
9-
GRUB_TIMEOUT=5
10-
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
11-
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
12-
GRUB_CMDLINE_LINUX=""
13-
```
14-
This is a basic introduction to booting Linux. However, the specifics may vary depending on the Linux distribution and the specific configurations of your system.
3+
Linux booting involves several stages: POST, MBR, GRUB, Kernel, Init, and GUI/CLI. The bootloader loads the kernel into memory, which detects hardware, loads drivers, mounts filesystems, starts system processes, and presents login prompts. GRUB configuration is managed through `/etc/default/grub` with settings like timeout and default boot options.

src/data/roadmaps/linux/content/[email protected]

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,3 @@
22

33
Linux system logs provide chronological records of events for debugging and troubleshooting, stored in `/var/log` directory. Use `dmesg` for kernel messages and `journalctl` for systemd logs. `journalctl -u service_name` shows logs for specific services. Essential skill for system administration, monitoring, and effective troubleshooting in Linux environments.
44

5-
Checking Logs Under Service Management in Linux plays a vital role in systems administration and troubleshooting procedures. Logs are fundamental for an in-depth understanding of what's going on inside a Linux system. These records provide a chronological record of events related to your system for use in debugging and troubleshooting problems.
6-
7-
Several essential logs generated by system processes, users and administrator actions can be found in `/var/log` directory. Logs can be accessed and viewed using several commands. For example, the `dmesg` command can be used to display the kernel ring buffer. Most system logs are managed by `systemd` and can be checked using the command `journalctl`.
8-
9-
```shell
10-
journalctl
11-
```
12-
13-
This command will show the entire system log from the boot to the moment you're calling the journal.
14-
15-
To display logs for a specific service, the `-u` option can be used followed by the service's name.
16-
17-
```shell
18-
journalctl -u service_name
19-
```
20-
21-
Remember, understanding and monitoring your system logs will provide you a clear view of what's going on in your Linux environment. It is a vital skill worth developing to effectively manage and troubleshoot systems.

src/data/roadmaps/linux/content/[email protected]

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,6 @@
11
# Command Help
22

3-
Command help in Linux is an essential feature that enables users to navigate through Linux shell commands with ease. This feature displays brief information on how to use these commands. For instance, typing 'man' before any command brings up the manual entry for that command which explains what the command does, its syntax and the available options. Another popular command is 'help' which is more suited for shell built-in functions, giving a brief description about each. These command line services are extremely beneficial for beginners trying to learn how to use the Linux shell, as well as seasoned users who may need to look up the specifics of seldom used commands. You can also get a TLDR of a command with example usage by using the TLDR package.
4-
5-
To view the manual entry for any command, use:
6-
7-
```bash
8-
man [command]
9-
```
10-
11-
For built-in shell functions, use:
12-
13-
```bash
14-
help [command]
15-
```
16-
17-
Moreover, you can add the *--help* flag to almost any command to get more information about it.
18-
For example:
19-
```bash
20-
date --help
21-
```
22-
23-
To view examples with TLDR, use:
24-
25-
```bash
26-
tldr [command]
27-
```
3+
Linux command help provides documentation and usage information for shell commands. Use `man command` for detailed manuals, `help command` for shell built-ins, `command --help` for quick options, and `tldr command` for practical examples. Essential for learning command syntax, parameters, and functionality in Linux terminal environments.
284

295
Learn more from the following resources:
306

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
11
# Conditionals
22

3-
Shell conditionals allow scripts to make decisions based on conditions using `if`, `elif`, and `else` statements. These control process flow by evaluating string variables, arithmetic tests, or process status. Conditions are checked sequentially - if true, the corresponding code block executes; otherwise, it moves to the next condition until finding a match or reaching `else`.
4-
5-
Here's a simple illustration of how they work:
6-
7-
```bash
8-
#!/bin/sh
9-
a=10
10-
b=20
11-
12-
if [ $a -lt 20 ]
13-
then
14-
echo "a is less than b"
15-
elif [ $a -gt 20 ]
16-
then
17-
echo "a is greater than b"
18-
else
19-
echo "a is equal to b"
20-
fi
21-
```
22-
23-
In the above script, the condition inside the `if` statement is being checked. If the condition is `true`, then the code block inside the `if` statement gets executed, otherwise, it moves to the `elif` condition and so on. If none of those conditions is satisfied, then the code block inside the `else` statement will be executed.
3+
Shell conditionals allow scripts to make decisions based on conditions using `if`, `elif`, and `else` statements. These control process flow by evaluating string variables, arithmetic tests, or process status. Conditions are checked sequentially - if true, the corresponding code block executes; otherwise, it moves to the next condition until finding a match or reaching `else`.

src/data/roadmaps/linux/content/creating--deleting-files--dirs@9oo2fxTM2_p0VYPBroqxa.md

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,6 @@
1-
# Creating Files
1+
# Creating and Deleting Files
22

3-
Creating files in Linux is about making new blank or filled files on your computer. You can use commands like `touch` to create an empty file, `echo` to make a file with some text inside, or `cat` to type directly into a new file. These commands help you set up and save your documents or data.
4-
5-
Here's an example of file creation with the `touch` command:
6-
7-
```bash
8-
touch newfile.txt
9-
```
10-
11-
and with `cat` command:
12-
13-
```bash
14-
cat > newfile.txt
15-
```
16-
17-
Both these commands create a new "newfile.txt" if it does not already exist.
18-
19-
# Deleting Files
20-
21-
Deleting files in Linux means getting rid of unwanted or unnecessary files from your computer. You use the `rm` command to delete a file, and it's permanent, so be careful. You can also use `rm -i` (interactive) to ask for confirmation before deleting, which helps prevent accidental loss of important files.
22-
23-
```bash
24-
# Deletes the file named example.txt
25-
rm example.txt
26-
```
27-
28-
```bash
29-
# Ask for confirmation
30-
rm -i [filename]
31-
```
32-
33-
```bash
34-
# Removes an empty directory
35-
rmdir [directory]
36-
```
3+
Linux file operations include creating files with `touch` (empty files) or `cat > filename` (with content) and deleting with `rm filename`. Use `rm -i` for confirmation prompts and `rmdir` for empty directories. File deletion is permanent - no recycle bin. Essential commands for basic file management and system administration.
374

385
Learn more from the following resources:
396

src/data/roadmaps/linux/content/creating-files@9oo2fxTM2_p0VYPBroqxa.md

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,6 @@
11
# Creating Files
22

3-
Creating files in Linux is about making new blank or filled files on your computer. You can use commands like `touch` to create an empty file, `echo` to make a file with some text inside, or `cat` to type directly into a new file. These commands help you set up and save your documents or data.
4-
5-
Here's an example of file creation with the `touch` command:
6-
7-
```bash
8-
touch newfile.txt
9-
```
10-
11-
and with `cat` command:
12-
13-
```bash
14-
cat > newfile.txt
15-
```
16-
17-
Both these commands create a new "newfile.txt" if it does not already exist.
18-
19-
# Deleting Files
20-
21-
Deleting files in Linux means getting rid of unwanted or unnecessary files from your computer. You use the `rm` command to delete a file, and it’s permanent, so be careful. You can also use `rm -i` (interactive) to ask for confirmation before deleting, which helps prevent accidental loss of important files.
22-
23-
```bash
24-
# Deletes the file named example.txt
25-
rm example.txt
26-
```
27-
28-
```bash
29-
# Ask for confirmation
30-
rm -i [filename]
31-
```
32-
33-
```bash
34-
# Removes an empty directory
35-
rmdir [directory]
36-
```
3+
Linux file creation uses `touch` for empty files, `echo "text" > filename` for text files, or `cat > filename` for interactive input. Commands like `mkdir` create directories. File creation is immediate and permanent. Essential for organizing data, scripts, and configuration files in Linux systems.
374

385
Learn more from the following resources:
396

src/data/roadmaps/linux/content/[email protected]

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,3 @@
22

33
Creating Linux services involves setting up background applications using systemd service files. Services run continuously performing essential tasks like web servers, databases, and mail servers. Create `.service` files in `/etc/systemd/system/` with Unit, Service, and Install sections. Control services using `systemctl` commands. Best practice: avoid running services as root for security.
44

5-
In Linux, service management refers to starting, stopping, enabling, and managing software services. Understanding how to control services is crucial for controlling a Linux server or desktop.
6-
7-
Typically, a service is an application that runs in the background waiting to be used, or carrying out essential tasks. Common kinds of services include web servers, database servers, and mail servers.
8-
9-
Creating services in Linux would thus refer to the process of setting up these background applications to run and perform the desired tasks. This process often includes writing service files (script) that specify how to start, stop, and restart the service using a service management system.
10-
11-
The most common service management system in modern Linux distributions is systemd. With systemd, services are defined by placing service unit files in specific directories.
12-
13-
For instance, we could create a simple `my_service.service` file:
14-
15-
```
16-
[Unit]
17-
Description=My Custom Service
18-
After=network.target
19-
20-
[Service]
21-
ExecStart=/path/to/your/executable
22-
23-
[Install]
24-
WantedBy=multi-user.target
25-
```
26-
27-
This service file can be placed under `/etc/systemd/system/` to make systemd recognize it. You would then control the service using `systemctl`, systemd's command tool.
28-
29-
Note that best practices in Linux dictate that we should not run services as root whenever possible, for security reasons. Instead, we should create a new user to run the service.

0 commit comments

Comments
 (0)