Linux Basics
Linux is family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds.
See Linux on Wikipedia.
Brap uses Linux as it is a great development environment, and Ubuntu, as the Debian-based Linux distribution.
We only aim to set a very basic guide here. Here are some great starter guide links you want to see:
- https://ubuntu.com/tutorials/command-line-for-beginners
- https://www.digitalocean.com/community/tutorials/an-introduction-to-linux-basics
The Terminal
A Terminal is a command-line interface (CLI) to your Linux operating system.
See command-lin interface on Wikipedia.
Using the integrated Terminal of VS Code, you can interact with your Linux Container efficiently.
Learn more about VS Code Terminal Basics.
Here is a Youtube video by Linux For Everyone explaining the The REAL Reason Linux Users Love The Command Line:
Youtube video: The REAL Reason Linux Users Love The Command Line
The File Hierarchy Standard
The File Hierarchy Standard (FHS) is a universal standard for for filesystem directory structure. The FHS defines a set of directories that each serve a specific purpose. Ubuntu and almost all other Linux distributions adhere to this standard.
The forward slash (/
) is the root directory of the filesystem.
The home directory (~/
) is the directory where the user brought to when logged in to the shell.
Here is a Youtube video by ByteByteGo explaining the the Linux File System Explained!:
Youtube video: Linux File System Explained
Navigation
You can navigate throughout the Linux filesystem's directory tree.
To display which directory the user is in, run the pwd
(print working directory) command:
pwd
To display the list of directories in the current working directory, run the ls
command:
ls
To create directories, run the mkdir
(make directory) command:
mkdir mynewdirectory
mkdir directory1 directory2
mkdir /foe/bar
To navigate in to one of the directory, run the cd
(change directory) command:
cd directory1
cd /foe/bar
cd ~/
To delete directories, run the rm
(remove) or rmdir
commands:
rm -d directory1-that-is-empty
rmdir /foe-that-is-empty
rm -r /directory-with-sub-directories-and-files
File Manipulation
You can create, edit, view files throughout the Linux filesystem.
To create a file, run the touch
command:
touch file1.txt
To move a file to a another directory, run the mv
(move) command:
mv file1.txt /foe/file1.txt
To rename a file, run the mv
command:
mv /foe/file1.txt /foe/file1-updated.txt
To copy a file, run the cp
(copy) command:
cp /foe/file1-updated.txt /foe/file1-copy.txt
To edit the contents of files, use a file editor, such as nano or Vim.
To edit the content of a file using nano, run the nano
command:
nano /foe/file1.txt
nano /foe/file3.txt
To display the entire content of a file, run the cat
command:
cat /foe/file1.txt
To display the paginated content of a file, run the less
command:
less /foe/file3-with-very-large-content.txt
Moving Forward
There are many Linux other Linux commands you can use to interact with Linux operating system. The examples provided here are only the basics. There are many guides you can find throughout the world wide web.
One way to know more about a Linux command is to
use the man
(manual) command:
man ls
man mv
man nano
To display a list of the available commands, display
the files in the /bin
directory:
ls /bin
ls -1 /bin
Keywords
- linux
- operating system
- os
- terminal
- command line
- bash
- basic
- container
- virtual machine