Update content of Linux fundamentals (#6190)

pull/6195/head^2
Rahul Kumar 3 months ago committed by GitHub
parent c3972382af
commit b0b01e7b83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12019
      package-lock.json
  2. 8
      src/data/roadmaps/linux/content/100-navigation-basics/100-basic-commands.md
  3. 2
      src/data/roadmaps/linux/content/100-navigation-basics/101-moving-files.md
  4. 24
      src/data/roadmaps/linux/content/100-navigation-basics/102-creating-files.md
  5. 12
      src/data/roadmaps/linux/content/100-navigation-basics/103-directory-hierarchy.md
  6. 17
      src/data/roadmaps/linux/content/100-navigation-basics/index.md
  7. 23
      src/data/roadmaps/linux/content/101-editing-files/100-vim.md
  8. 19
      src/data/roadmaps/linux/content/101-editing-files/101-nano.md
  9. 14
      src/data/roadmaps/linux/content/101-editing-files/index.md

12019
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,16 +1,20 @@
# Linux Navigation Basics: Basic Commands
In the world of Linux, understanding how to navigate through the system is quite essential. Unlike many other modern operating systems, Linux primarily uses command-line interfaces (CLI) thereby, making it necessary to get comfortable with different commands. These basic commands under Linux navigation involve moving around the file system, viewing the contents of directories, creating, renaming or deleting files/directories, and more. Navigating through Linux using these commands not only increases efficiency, but also provides a deeper understanding of the system's file and directory structure.
Linux Navigation Basics is about using simple commands to move around and manage files on your computer. For example, cd lets you go into different folders, ls shows you what files and folders are inside, and pwd tells you where you are currently. These commands help you easily find and organize your files.
```bash
# Change directory
cd /path/to/directory
# List contents of a directory
# Lists files and directories in the current directory.
ls
# View current working directory
pwd
# Displays the mannual page for a command
man ls
```
In this brief introduction, we will discuss and explore these basic commands and how they aid us in navigation around the Linux environment.

@ -10,4 +10,4 @@ mv [options] source destination
Here, `source` denotes the file or directory that you want to move while `destination` denotes the location where you want to move your source file or directory.
The `mv` command is widely used because of its simplicity and versatility. Whether you want to organize your files by moving them into different directories or rename a bunch of files, the `mv` command is your go-to tool in Linux.
The `mv` command is widely used because of its simplicity and versatility. Whether you want to organize your files by moving them into different directories or rename a bunch of files, the `mv` command is your go-to tool in Linux.

@ -1,8 +1,6 @@
# Creating Files
Linux provides a versatile and powerful command-line interface (CLI) that helps users perform various tasks including file creation and navigation. Learning how to create files is among the fundamental skills for novices venturing into the Linux world. One of the simplest ways to create a file in Linux is with the `touch` command. This command, when supplied with the name of a file as a parameter, either creates a new file with the given name or, if a file with such name is already present, updates the last modified time of the file.
Another useful command for creating files is `cat >filename`. This command creates a new file with the specified name and waits for user input. Hence, the process ends when you press `Ctrl+D` to send `EOF` (End-Of-File) to the `cat` command.
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.
Here's an example of file creation with the `touch` command:
@ -16,4 +14,22 @@ and with `cat` command:
cat > newfile.txt
```
Both these commands create a new "newfile.txt" if it does not already exist.
Both these commands create a new "newfile.txt" if it does not already exist.
# Deleting Files
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.
```bash
# Deletes the file named example.txt
rm example.txt
```
```bash
# Ask for confirmation
rm -i [filename]
```
```bash
# Removes an empty directory
rmdir [directory]
```

@ -2,9 +2,15 @@
In Linux, understanding the directory hierarchy is crucial for efficient navigation and file management. A Linux system's directory structure, also known as the Filesystem Hierarchy Standard (FHS), is a defined tree structure that helps to prevent files from being scattered all over the system and instead organise them in a logical and easy-to-navigate manner.
Each directory serves a specific purpose. For instance, `/bin` holds binary executable files (command files), `/etc` has system configuration files, `/home` stores users' personal files, and `/var` contains varying files such as logs and print queues.
No code snippet is necessary as understanding directory hierarchy is a conceptual knowledge and doesn't involve code execution.
- `/`: Root directory, the top level of the file system.
- `/home`: User home directories.
- `/bin`: Essential binary executables.
- `/sbin`: System administration binaries.
- `/etc`: Configuration files.
- `/var`: Variable data (logs, spool files).
- `/usr`: User programs and data.
- `/lib`: Shared libraries.
- `/tmp`: Temporary files.
Visit the following resources to learn more:

@ -1,6 +1,6 @@
# Navigation Basics
In Linux, navigation between directories and files is a fundamental, yet essential function that allows you to exploit the power of the command-line interface (CLI). Mastering the basic Linux navigation commands such as `cd`, `pwd`, `ls`, and `tree` enables you to flawlessly move from one point to another within the filesystem, display the list of files & directories, and understand your position relative to other system components. These commands are advantageous not just to system administrators but to anyone interacting with Linux environments, hence familiarizing yourself with them is a critical step in building Linux proficiency.
In Linux, navigation between directories and files is a fundamental, yet essential function that allows you to exploit the power of the command-line interface (CLI). Mastering the basic Linux navigation commands such as `cd`, `pwd`, `ls`, and `tree` enables you to flawlessly move from one point to another within the filesystem, display the list of files & directories, and understand your position relative to other system components.
Here is how you use these commands:
@ -10,20 +10,13 @@ Here is how you use these commands:
cd /path/to/directory
```
- To print the current directory, use the `pwd` command:
```bash
pwd
```
- To list the contents of a directory, use the `ls` command:
```bash
ls
```
Visit the following resources to learn more:
- The `tree` command displays directories as trees (system hierarchy):
```bash
tree
```
- [@article@Intro to Linux](https://www.linkedin.com/pulse/intro-linux-fundamentals-what-hillary-nyakundi-4u7af/)
- [@video@Linux fundamentals](https://www.youtube.com/watch?v=kPylihJRG70&t=1381s&ab_channel=TryHackMe)
- [@article@Practice on Linux fundamentals]( https://linuxjourney.com/)

@ -1,14 +1,25 @@
# Vim: An Essential Tool for Editing Files
# Vim: An Essential Tool for Editing Files
Vim, an acronym for 'Vi Improved', is a highly configurable and complex text editor built to enable efficient text editing in Linux environments. It is an improved version of the 'vi' editor, a standard text editor that comes with a UNIX operating system. While learning Vim can have a steep learning curve, its powerful features allow users to accomplish tasks more quickly than with many other text editors.
Vim (Vi Improved) is a powerful and flexible text editor used in Unix-like systems. It builds on the original Vi editor with additional features and improvements, including multi-level undo, syntax highlighting, and an extensive set of commands for text manipulation.
<br>
Vim operates primarily in three modes:
One of the key reasons that make Vim popular among developers is its ability to handle large files adeptly, having a less memory footprint. Moreover, it operates in different modes such as 'command mode', 'insert mode', and 'visual mode' which eases the process of editing files.
Although the challenge of learning Vim may seem daunting, it is a fundamental tool for anyone seeking mastery in the Linux environment.
- Normal (for navigation and manipulation).
- Insert (for editing text).
- Command (for executing commands).
A simple use of Vim to edit a 'example.txt' file would look like this:
```bash
vim example.txt
```
To insert new content, press 'i' for 'insert mode'. After editing, press 'ESC' to go back to 'command mode', and type ':wq' to save and quit.
To insert new content, press 'i' for 'insert mode'. After editing, press 'ESC' to go back to 'command mode', and type ':wq' to save and quit.
To learn more, visit this:
<br>
Check out this [Github repo](https://github.com/iggredible/Learn-Vim?tab=readme-ov-file) on Vim from basic to advanced.
- [@article@Learn Vim Progressively](https://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/)
- [@video@Vim basics](https://www.youtube.com/watch?v=wACD8WEnImo&list=PLT98CRl2KxKHy4A5N70jMRYAROzzC2a6x&ab_channel=LearnLinuxTV)
- [@article@Platform to practice Vim](https://vim-adventures.com/)

@ -1,13 +1,26 @@
# Nano: A File Editing Tool
Nano is a popular, user-friendly text editor used for creating and editing files directly within the Linux command line interface (CLI). It is an alternative to editors like Vi and Emacs and is considered more straightforward for beginners due to its simple and intuitive interface.
Nano is a popular, user-friendly text editor used for creating and editing files directly within the Linux command line interface (CLI). It is an alternative to editors like `Vi` and `Emacs` and is considered more straightforward for beginners due to its simple and intuitive interface.
Nano comes pre-installed with many Linux distributions and can be used for various tasks, such as writing scripts, editing configuration files, or taking quick notes. With its interactive command line interface, Nano offers a unique blend of usability and functionality.
Nano comes pre-installed with many Linux distributions but if it's not installed, here's how to do it for popular Linux distributions.
```bash
# Ubuntu based distributions
sudo apt update
sudo apt install nano
```
```bash
# Arch Linux
sudo pacman -S nano
```
To use Nano to edit or create files in Linux, the following command can be used:
```bash
nano filename
```
Visit the following resources to learn more:
This command opens the named file or creates a new one if it doesn't exist yet. All the editing is done within the terminal itself. While using Nano, the command options are always visible at the bottom of the screen, making it an excellent choice for Linux beginners or those preferring straightforward text editing tools.
- [@article@Blog on nano](https://ioflood.com/blog/nano-linux-command/)
- [@article@Nano-text-editor](https://www.geeksforgeeks.org/nano-text-editor-in-linux/)
- [@video@Nano editor fundamentals](https://www.youtube.com/watch?v=gyKiDczLIZ4&ab_channel=HackerSploit)

@ -7,7 +7,17 @@ For instance, `nano` is a basic text editor, which is easy to use and perfect fo
To edit a file you first need to open it using a command like:
```bash
nano filename
nano [filename]
```
This command will open the file `filename` in the `nano` editor. Once open, you can make changes to the file, save, and exit it. Other editors like `vi/vim` and `emacs` have their own specific commands for editing, saving and exiting files. It's essential to learn the basic commands of your chosen editor to efficiently work with files in Linux.
```bash
vi [filename] or vim [filename]
```
```bash
gedit [filename]
```
Visit the following resources to learn more:
- [@article@How to edit a file](https://www.scaler.com/topics/how-to-edit-a-file-in-linux/)
- [@article@Linux edit file](https://www.javatpoint.com/linux-edit-file)
Loading…
Cancel
Save