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.
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
```bash
# Change directory
# Change directory
cd /path/to/directory
cd /path/to/directory
@ -18,3 +17,7 @@ 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.
In this brief introduction, we will discuss and explore these basic commands and how they aid us in navigation around the Linux environment.
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.
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.
Learn more from the following resources:
- [@article@Linux mv Command: File Moving and Renaming](https://labex.io/tutorials/linux-linux-mv-command-file-moving-and-renaming-209743)
@ -14,4 +14,4 @@ In Linux, understanding the directory hierarchy is crucial for efficient navigat
Visit the following resources to learn more:
Visit the following resources to learn more:
- [Overview of File System Hierarchy Standard (FHS)](https://access.redhat.com/documentation/ru-ru/red_hat_enterprise_linux/4/html/reference_guide/s1-filesystem-fhs#s3-filesystem-usr).
- [Overview of File System Hierarchy Standard (FHS)](https://access.redhat.com/documentation/ru-ru/red_hat_enterprise_linux/4/html/reference_guide/s1-filesystem-fhs#s3-filesystem-usr).
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.
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:
Vim operates primarily in three modes:
- Normal (for navigation and manipulation).
- Normal (for navigation and manipulation).
@ -17,7 +17,7 @@ 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:
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.
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/)
- [@article@Learn Vim Progressively](https://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/)
@ -7,6 +7,7 @@ Usually, when you type a command in the terminal, the shell needs to know the ab
```sh
```sh
echo $PATH
echo $PATH
```
```
Running this command in a Linux terminal will return all the directories that the shell will search, in order, to find the command it has to run. The directories are separated by a colon.
Running this command in a Linux terminal will return all the directories that the shell will search, in order, to find the command it has to run. The directories are separated by a colon.
This feature makes using Linux command-line interface convenient and efficient.
This feature makes using Linux command-line interface convenient and efficient.
Remember, every shell, such as Bourne shell, C shell, or Korn shell in Unix or Linux has different syntax and semantics to define and use environment variables.
Remember, every shell, such as Bourne shell, C shell, or Korn shell in Unix or Linux has different syntax and semantics to define and use environment variables.
Learn more from the following resources:
- [@article@Environment Variables in Linux](https://labex.io/tutorials/linux-environment-variables-in-linux-385274)
This command will write the output of 'ls -al' into 'file_list.txt', whether or not the file initially existed. It will be created if necessary, and if it already exists – it will be overwritten.
This command will write the output of 'ls -al' into 'file_list.txt', whether or not the file initially existed. It will be created if necessary, and if it already exists – it will be overwritten.
Learn more from the following resources:
- [@article@Logical Commands and Redirection](https://labex.io/tutorials/linux-logical-commands-and-redirection-387332)
@ -19,4 +19,9 @@ tar cvzf archive_name.tar.gz directory_to_archive/
#To create a bzip2 compressed tar archive:
#To create a bzip2 compressed tar archive:
tar cvjf archive_name.tar.bz2 directory_to_archive/
tar cvjf archive_name.tar.bz2 directory_to_archive/
```
```
Remember, in Linux, archiving and compression are separate processes, hence `tar` to archive and `gzip`/`bzip2` to compress. Although they're commonly used together, they can very much be used separately as per the requirements.
Remember, in Linux, archiving and compression are separate processes, hence `tar` to archive and `gzip`/`bzip2` to compress. Although they're commonly used together, they can very much be used separately as per the requirements.
Learn more from the following resources:
- [@article@Linux File Packaging and Compression](https://labex.io/tutorials/linux-file-packaging-and-compression-385413)
@ -4,12 +4,19 @@ Working with files is an essential part of Linux and it's a skill every Linux us
Linux provides multiple command-line utilities to create, view, move or search files. Some of the basic commands for file handling in Linux terminal include `touch` for creating files, `mv` for moving files, `cp` for copying files, `rm` for removing files, and `ls` for listing files and directories.
Linux provides multiple command-line utilities to create, view, move or search files. Some of the basic commands for file handling in Linux terminal include `touch` for creating files, `mv` for moving files, `cp` for copying files, `rm` for removing files, and `ls` for listing files and directories.
For instance, to create a file named "example.txt", we use the command:
For instance, to create a file named "example.txt", we use the command:
```bash
```bash
touch example.txt
touch example.txt
```
```
To list files in the current directory, we use the command:
To list files in the current directory, we use the command:
```bash
```bash
ls
ls
```
```
Knowing how to effectively manage and manipulate files in Linux is crucial for administering and running a successful Linux machine.
Knowing how to effectively manage and manipulate files in Linux is crucial for administering and running a successful Linux machine.
In this example, `tr` is used to convert the lowercase 'hello' to uppercase 'HELLO'. It's an essential tool for text processing tasks in the Linux environment.
In this example, `tr` is used to convert the lowercase 'hello' to uppercase 'HELLO'. It's an essential tool for text processing tasks in the Linux environment.
Learn more from the following resources:
- [@article@Linux tr Command: Character Translating](https://labex.io/tutorials/linux-linux-tr-command-character-translating-388064)
@ -5,8 +5,13 @@ The `head` command in Linux is a text processing utility that allows a user to o
```bash
```bash
head file.txt
head file.txt
```
```
The number of output lines can be customized using an option. For example, to display first 5 lines, we use `-n` option followed by the number of lines:
The number of output lines can be customized using an option. For example, to display first 5 lines, we use `-n` option followed by the number of lines:
```bash
```bash
head -n 5 file.txt
head -n 5 file.txt
```
```
Learn more from the following resources:
- [@article@Linux head Command: File Beginning Display](https://labex.io/tutorials/linux-linux-head-command-file-beginning-display-214302)
In the above example, the `tail` command will print the last 10 lines of the `/var/log/syslog` file. This is particularly useful in checking the most recent system log entries.
In the above example, the `tail` command will print the last 10 lines of the `/var/log/syslog` file. This is particularly useful in checking the most recent system log entries.
Learn more from the following resources:
- [@article@Linux tail Command: File End Display](https://labex.io/tutorials/linux-linux-tail-command-file-end-display-214303)
If no file is specified, `nl` will wait for input from user's terminal (stdin). Its clear and readable output makes it a valuable part of any Linux user's text processing toolkit.
If no file is specified, `nl` will wait for input from user's terminal (stdin). Its clear and readable output makes it a valuable part of any Linux user's text processing toolkit.
Learn more from the following resources:
- [@article@Linux nl Command: Line Numbering](https://labex.io/tutorials/linux-linux-nl-command-line-numbering-210988)
This command would output the number of lines, words, and characters in `myfile.txt`. The output is displayed in the following order: line count, word count, character count, followed by the filename.
This command would output the number of lines, words, and characters in `myfile.txt`. The output is displayed in the following order: line count, word count, character count, followed by the filename.
Learn more from the following resources:
- [@article@Linux wc Command: Text Counting](https://labex.io/tutorials/linux-linux-wc-command-text-counting-219200)
In this example, `names.txt` is a file containing a list of names. The `sort` command sorts all the lines in the file, and then the `uniq` command removes all the duplicate lines. The resulting output would be a list of unique names from `names.txt`.
In this example, `names.txt` is a file containing a list of names. The `sort` command sorts all the lines in the file, and then the `uniq` command removes all the duplicate lines. The resulting output would be a list of unique names from `names.txt`.
The entire concept of user management circles around providing proper accessibility, and maintaining the security of the Linux operating system. Other commands such as `passwd` for password management or `su` for switching users further emphasize the depth and importance of user management in Linux.
The entire concept of user management circles around providing proper accessibility, and maintaining the security of the Linux operating system. Other commands such as `passwd` for password management or `su` for switching users further emphasize the depth and importance of user management in Linux.