Introduction to Linux
Linux is a free and open-source operating system that is widely used in modern computing systems including servers, supercomputers, mobile devices, and embedded devices. Compared to proprietary alternatives, Linux allows users to modify and optimize the system to match their specific needs. Additionally, its powerful security features make it a popular choice for web servers and other critical infrastructure.
Linux is widely used in web3 applications due to its ability to support decentralized applications (dapps). Its modular and scalable design allows developers to build dapps that can run on a variety of devices and architectures, making it a key component in the web3 technology stack.
This lesson will cover fundamental skills and commands for working with Linux, including creating and manipulating files and directories, managing permissions and security, and using key commands to navigate and manage the system.
Lesson objectives
Create and manipulate folders and files
Create and manage permissions, security, and services
Learn key commands
Create and manipulate folders and files
ls
ls
is a command used in Unix-like operating systems to list the files and directories in a given directory.
To list the contents of the current directory:
To list the contents of a specific directory:
To list the contents of a directory in long format (displays more information about each file):
To list the contents of a directory including hidden files:
mkdir
mkdir
is a command used in Unix-like operating systems to create a new directory. It stands for "make directory." You can use it to create a new directory in the current directory or to create a new directory with a specified path.
To create a new directory in the current directory:
To create a new directory with a specified path:
To create a new directory with multiple nested directories:
Note: The -p option creates all the directories in the specified path, even if some of the parent directories do not exist.
To create multiple directories at once:
Note: This will create three directories named "directory1," "directory2," and "directory3" in the current directory.
cd
cd
is a command used in Unix-like operating systems to change the current working directory. It stands for "change directory." You can use it to navigate to a different directory in the file system.
To change to the home directory:
To change to a specific directory:
To change to the parent directory:
To change to the previous directory:
Note: This will switch to the previous directory you were in.
To change to a directory using a relative path:
Note: This will change to a directory relative to the current working directory.
touch
touch
is a command used in Unix-like operating systems to create an empty file or update the timestamp of an existing file. It stands for "touch file." You can use it to create a new file or update the modification time of an existing file without changing its content.
To create a new empty file:
Note: This will create an empty file named "filename.txt" in the current directory.
To create multiple files at once:
Note: This will create three empty files named "file1.txt," "file2.txt," and "file3.txt" in the current directory.
To update the modification time of a file to a specific time:
Note: This will update the modification time of the file "filename.txt" to January 1, 2022, at 1:01:01.01 AM.
git
git
is a command-line tool used for version control in software development. It allows developers to track changes to source code over time, collaborate with others on the same project, and revert to earlier versions of the code if necessary. With Git, you can create branches to experiment with new features, merge changes from different branches, and manage the history of the codebase.
To initialize a new Git repository:
Note: This will create a new Git repository in the current directory.
To add files to the staging area:
Note: This will add the file "filename.txt" to the staging area, which is where you prepare changes to be committed.
To commit changes to the repository:
Note: This will commit the changes in the staging area to the repository with a message describing the changes.
To create a new branch:
Note: This will create a new branch named "new-branch" based on the current branch.
To switch to a different branch:
Note: This will switch to the branch named "branch-name."
To merge changes from one branch into another:
Note: This will merge the changes from the branch named "branch-name" into the current branch.
nano
nano
is a command-line text editor for Unix-like operating systems. It allows users to create and edit text files in the terminal. With nano, you can create new files, open existing files, make changes to text, and save the changes. It is a beginner-friendly editor that is easy to use and learn.
To create a new file:
Note: This will open a new file named "filename.txt" in the nano editor.
This will open a new file named "filename.txt" in the nano editor.
Note: This will open the existing file named "existing_file.txt" in the nano editor.
To make changes to the text:
To save changes:
To search for text:
To cut, copy, and paste text:
vim
vim
is a command-line text editor for Unix-like operating systems. It allows users to create and edit text files in the terminal. With vim, you can create new files, open existing files, make changes to text, and save the changes. It is a powerful and customizable editor that can be used efficiently with keyboard shortcuts. It is widely used by developers and system administrators.
To create a new file:
Note: This will open a new file named "filename.txt" in the vim editor.
To open an existing file:
Note: This will open the existing file named "existing_file.txt" in the vim editor.
To make changes to the text:
To save changes:
To search for text:
To cut, copy, and paste text:
cp
cp
is a command used in Unix-like operating systems to copy files or directories. It allows users to create a duplicate copy of an existing file or directory. The basic syntax of the cp
command is cp source destination
. The source
parameter is the file or directory that you want to copy, and the destination
parameter is where you want to copy the file or directory to.
To copy a file to another location:
Note: This will copy the file "file.txt" to the specified destination directory.
To copy a file and rename it:
Note: This will create a copy of "file.txt" with the new name "newfile.txt" in the same directory.
To copy a directory and its contents:
Note: This will copy the directory "directory" and its contents to the specified destination directory.
To overwrite an existing file:
Note: This will copy the file "source_file.txt" to "destination_file.txt", overwriting it if it already exists. The -r option is used to copy directories recursively, and the -f option is used to force overwriting of existing files without prompting for confirmation.
mv
mv
is a command used in Unix-like operating systems to move or rename files and directories. It allows users to change the location or name of an existing file or directory. The basic syntax of the mv
command is mv source destination
. The source
parameter is the file or directory that you want to move or rename, and the destination
parameter is where you want to move or rename the file or directory to.
To move a file to another location:
Note: This will move the file "file.txt" to the specified destination directory.
To rename a file:
Note: This will rename the file "oldname.txt" to "newname.txt" in the same directory.
To move a directory and its contents:
Note: This will move the directory "directory" and its contents to the specified destination directory.
To overwrite an existing file:
Note: This will move the file "source_file.txt" to "destination_file.txt", overwriting it if it already exists. The
-f
option is used to force overwriting of existing files without prompting for confirmation.
cat
cat
is a command used in Unix-like operating systems to display the contents of a file on the terminal. It allows users to view the content of one or more files in their entirety. The basic syntax of the cat command is cat file1 file2 file3. The file1, file2, and file3 parameters represent the names of the files that you want to view the contents of.
To display the contents of a single file:
Note: This will display the contents of the file "file.txt" on the terminal.
To concatenate multiple files into one file:
Note: This will concatenate the contents of "file1.txt" and "file2.txt" into a new file named "combined.txt".
To display the contents of a file with line numbers:
Note: This will display the contents of the file "file.txt" on the terminal with line numbers added to each line.
To display the contents of a file and scroll through it:
Note: This will display the contents of the file "file.txt" on the terminal using the less command, which allows for scrolling through the file. The > operator is used to redirect the output of the cat command to a new file, and the | operator is used to pipe the output of one command to another command.
echo
echo
is a command used in Unix-like operating systems to print text to the terminal or redirect it to a file. It allows users to output text or variables as text strings. The basic syntax of the echo
command is echo [option] [string]
. The [option]
parameter is optional and can be used to modify the behavior of the echo
command, while the [string]
parameter is the text that you want to print or redirect.
To display a message on the terminal:
Note: This will print the message "Hello, World!" on the terminal.
To redirect text to a file:
Note: This will create a new file named "text.txt" and write the text "This is a text file." to it.
To append text to an existing file:
Note: This will append the text "This is more text." to the end of the existing "text.txt" file.
To use a variable in an echo statement:
Note: This will print the message "My name is John." on the terminal, using the variable $NAME in the text string. The > operator is used to redirect the output of the echo command to a new file, and the >> operator is used to append the output to an existing file.
>
The >
operator is used in Unix-like operating systems to redirect the output of a command to a file. It allows users to create a new file or overwrite the contents of an existing file with the output of a command. The basic syntax of the >
operator is command > file
. The command
parameter represents the command whose output you want to redirect, and the file
parameter represents the file that you want to redirect the output to.
To redirect the output of a command to a file instead of displaying it on the terminal:
Note: This will run the ls command with the -la option, which lists all files in the current directory, including hidden files, and redirects the output to a new file named "file_list.txt".
>>
The >>
operator is used in Unix-like operating systems to append the output of a command to an existing file. It allows users to add new content to the end of a file without overwriting any existing content. The basic syntax of the >>
operator is command >> file
. The command
parameter represents the command whose output you want to append, and the file
parameter represents the file that you want to append the output to.
To append the output of a command to an existing file:
Note: This will run the ls command with the -la option, which lists all files in the current directory, including hidden files, and append the output to an existing file named "file_list.txt".
|
The |
(pipe) operator in Unix-like operating systems is used to redirect the output of one command to the input of another command. It allows users to chain together multiple commands to perform more complex operations without having to save intermediate results to files. The basic syntax of the |
operator is command1 | command2
. The command1
parameter represents the command whose output you want to redirect, and the command2
parameter represents the command that will receive the redirected output as input.
To list all files in the current directory and then search for a specific file within that list:
Note: This will list all files in the current directory and then search for the string "specific_file" within that list.
To count the number of files in the current directory:
Note: This will list all files in the current directory and then count the number of lines in the output, which is equivalent to the number of files in the directory.
To sort the output of a command alphabetically:
Note: This will run the command and sort the output alphabetically. The | operator can be used with any command that produces output to the console. It is a powerful tool for chaining together commands to perform more complex operations.
rm
The rm
command in Unix-like operating systems is used to remove or delete files and directories. The basic syntax of the rm
command is rm [options] [file(s)]
. The options
parameter represents any additional options you want to use with the command, and the file(s)
parameter represents the name(s) of the file(s) you want to remove. By default, rm
does not prompt for confirmation before deleting files, so it's important to be careful when using this command.
To remove a single file:
Note: This will remove the file named "filename.txt" from the current directory.
To remove multiple files at once:
Note: This will remove the files named "file1.txt", "file2.txt", and "file3.txt" from the current directory.
To remove a directory and all its contents:
Note: This will remove the directory named "directory_name" and all its contents, including any files and subdirectories. The -r option is required to remove directories with rm, as directories are not removable by default. It's important to be careful when using the rm command, as it permanently deletes files and directories without any way to recover them.
curl
curl
is a tool used to transfer data to or from a server, using one of several supported protocols, including HTTP, FTP, and SMTP. The basic syntax of the curl
command is curl [options] [URL]
. The options
parameter represents any additional options you want to use with the command, and the URL
parameter represents the URL of the server you want to communicate with.
To retrieve the contents of a web page:
Note: This will retrieve the contents of the web page at https://example.com and display it in the terminal.
To download a file from a server:
Note: This will download the file named file.txt from the server at https://example.com and save it to the current directory.
To upload a file to a server:
Note: This will upload the file located at /path/to/file.txt to the server at https://example.com/upload.php using a POST request.
wget
wget
is a tool used to download files from the internet. It supports various protocols such as HTTP, HTTPS, and FTP. Its basic syntax is wget [options] [URL]
. The options
parameter represents any additional options you want to use with the command, and the URL
parameter represents the URL of the file you want to download. wget
is a powerful tool that can be used to download large files, recursively download entire directories, and continue interrupted downloads.
Download a file from a URL:
Download a file and save it with a different name:
Download a file and continue the download if it is interrupted:
Download multiple files from a URL:
Note: where urls.txt is a text file containing one URL per line.
Limit the download speed:
Download a file over FTP:
Download a file using a proxy server:
screen
screen
is a terminal multiplexer that allows you to create and manage multiple terminal sessions within a single window. With screen
, you can run multiple shell instances, detach from them and reattach to them later, and share sessions with other users. Once inside a screen session, you can use various keyboard shortcuts to navigate between multiple windows, split screens, and perform other tasks. screen
is particularly useful for remote server management or for running long-running processes that you want to keep running even if you log out of your shell.
Start a new screen session with a specific name:
Detach from a screen session:
Reattach to a detached screen session:
Create a new window within a screen session:
Switch between windows in a screen session:
Split the screen horizontally:
Split the screen vertically:
List available screen sessions:
tar
The tar
command is used for archiving and compressing files in a single file, often called a "tarball". It is a command-line utility commonly used in Linux and Unix operating systems.
To create a compressed tarball of a directory and its contents:
To extract a compressed tarball to a specific directory:
To add a file to an existing tarball:
To extract a specific file from an existing tarball:
To create an incremental backup of a directory using a dated tarball filename:
unzip
The unzip
command is used to extract files from a compressed archive in the ZIP format. Here's a short explanation:
To extract all files from an archive named archive.zip:
To extract a specific file named example.txt from an archive named archive.zip:
To extract an archive named archive.zip into a directory named extracted_files:
To list the contents of an archive named archive.zip without extracting them:
dtrx
The dtrx
command is a tool used for extracting various archive file formats. It can automatically detect the archive type and use the appropriate extraction tool. It can also handle nested archives, and can extract files to a specific directory.
To extract a single archive file named
archive.tar.gz
to the current directory:To extract a nested archive file named
nested_archive.zip
that is located within another archive file namedarchive.tar.gz
to the current directory:To extract a single archive file named
archive.tar.bz2
to a specific directory namedmy_folder
:To list the contents of an archive file named archive.tar.gz without extracting them:
Create and manage permissions, security, and services
chmod
chmod
is a command used in Linux/Unix to change the permissions of files or directories. It allows the user to grant or revoke read, write, and execute permissions to themselves, their group, or others. The permissions can be set using numerical values or symbols such as u (user), g (group), o (others), and a (all).
Set read, write, and execute permissions for the owner, and only read and execute permissions for the group and others:
Remove write permission for the group and others:
Add execute permission for the owner and group:
Set read and write permissions for the owner and group, but no permissions for others:
Recursively change the permissions for all files and directories in a directory:
chown
The chown
command is used in Linux/Unix to change the owner and/or group ownership of a file or directory. This command is particularly useful when transferring files or granting permissions. It allows the administrator to specify who can read, write, or execute the file/directory.
Change the ownership of a file to a specific user and group:
Note: This command changes the ownership of file.txt to the user user and the group group.
Change the ownership of a directory and all of its contents:
Note: This command recursively changes the ownership of the directory /path/to/directory and all of its contents to the user user and the group group.
Change the ownership of a file to the current user:
Note: This command changes the ownership of file.txt to the current user.
Change the ownership of a file to the root user:
Note: This command changes the ownership of file.txt to the root user.
whoami
The whoami
command in Linux displays the current username of the user who is logged in to the system. It is a simple and useful command that can be used to verify the identity of the current user.
To display the current user name:
To use the whoami output in a script:
Note: This script will output a greeting message that includes the current user name.
To check if the current user has sudo privileges:
Note: This command will check if the current user is "root" and print a message accordingly.
adduser
The adduser
command in Linux is used to create a new user account on the system. It prompts for the user's name and password, creates a home directory, and adds the user to the system. The command also allows for additional options such as specifying the user's group or setting a custom home directory.
To add a new user account with default settings:
To add a new user account and set the home directory:
To add a new user account with a specific user ID (UID):
To add a new user account with a specific group ID (GID):
To add a new user account and specify additional groups:
Note: The adduser command may vary depending on the Linux distribution and version being used. It is recommended to refer to the documentation for the specific system to ensure proper usage.
usermod
The usermod
command in Linux is used to modify user account attributes such as username, home directory, login shell, and group membership. It is used to make changes to an existing user account.
Change the username of an existing user:
Add a user to a secondary group:
Remove a user from a secondary group:
Lock or unlock a user account:
Change the default shell for a user:
sudo
sudo
is a command used in Linux to grant temporary root privileges to a normal user account. It allows users to execute commands with elevated privileges without logging in as the root user. The user running the sudo
command will need to enter their own password to confirm their identity. This helps to improve security by allowing administrators to grant certain privileges to users without giving them full administrative access.
Updates the list of available packages and their versions from the server:
Installs a package with administrative privileges:
Restarts a system service:
Adds a new user to the system:
Changes the file permission to allow read, write, and execute for the owner, and only read and execute for others.
su
The su
(short for "substitute user") command is used to switch to another user account or to run commands with a different user's privileges. When executed without specifying a username, it will switch to the root user. The su
command is often used by system administrators to perform administrative tasks that require elevated privileges. It is also commonly used to temporarily switch to another user's account in order to run commands or perform tasks as that user.
To switch to the root user:
To switch to another user, such as "jdoe":
To switch to a user without changing the current working directory:
To switch to a user and run a specific command as that user:
To switch to a user and start a new shell session as that user:
ssh
The ssh
command is used to establish a secure shell connection to a remote server. It allows a user to log in to a remote machine and execute commands on it securely. The command uses encryption to protect the communication between the client and the server, preventing unauthorized access to sensitive information.
To connect to a remote server with username and IP address:
To connect to a remote server with a specific port:
To specify a private key file for authentication:
To run a command on a remote server:
To copy a file from a remote server to a local machine:
ssh-keygen
The ssh-keygen
command is used to generate SSH keys for secure authentication between remote systems. It creates a public and private key pair that can be used to authenticate with a remote system without requiring a password. The private key is kept on the local system and the public key is added to the remote system's authorized keys file.
Generate a new RSA key pair with the default settings:
Generate a new Ed25519 key pair:
Generate a new RSA key pair with a specific name and location:
Generate a new key pair and set a passphrase:
Generate a new key pair and save it to a different directory:
ufw
ufw
stands for Uncomplicated Firewall, which is a user-friendly command-line tool for managing firewall rules in Ubuntu and other Linux distributions. It allows users to easily configure rules to block or allow incoming and outgoing network traffic on their system.
Enable the UFW firewall:
Allow incoming SSH traffic:
Allow incoming traffic on port 80 for HTTP:
Allow incoming traffic on port 443 for HTTPS:
Deny incoming traffic on a specific port:
Allow outgoing traffic to a specific IP address:
Delete a specific firewall rule:
Disable the UFW firewall:
systemctl
systemctl
is a command-line tool for controlling the systemd
system and service manager, which is used in most modern Linux distributions. It allows the user to manage and control various system services, daemons, and targets, such as starting, stopping, enabling, or disabling them.
To start a service:
To stop a service:
To restart a service:
To check the status of a service:
To enable a service to start at boot:
To disable a service from starting at boot:
To reload the configuration of a service:
To list all active services:
To check if a service is enabled:
To check if a service is running:
Some helpful commands
!!
The !!
command is a shell shortcut that allows you to repeat the previous command. It simply executes the previous command in the command history. It is a quick way to repeat a command without having to type it out again.
Suppose you mistakenly entered a command as a non-root user that required root permissions. You can use
sudo !!
to quickly execute the same command as root.If you want to repeat a command with slight modifications, you can use
!!
and then edit the command to suit your needs.If you accidentally typed a command incorrectly, you can use
!!
to repeat the corrected version of the command.
top
The top
command is a Linux utility that provides real-time information about the processes that are currently running on the system, as well as information about the system's overall resource usage. It displays a dynamic, ordered list of running processes and updates it periodically. The top
command is often used by system administrators to monitor the system's performance and identify processes that are consuming too many resources.
Simply run
top
to view a real-time dynamic display of the system's processes.Use
top -u username
to display all processes that belong to a particular user.To sort processes by CPU usage, press the "P" key. To sort by memory usage, press "M". To sort by process ID, press "N". To switch between ascending and descending order, press "R".
Use the
top -H
command to display individual threads of processes.Use
top -p PID
to view the information of a particular process using its PID.
htop
htop
is a command-line utility for monitoring system resources on Linux. It is an improved version of the top
command and provides a more user-friendly and interactive way of viewing and managing processes and system resource usage.
To start
htop
in interactive mode, simply run the commandhtop
in the terminal.To sort the processes by CPU usage, press the F6 key, select the "PERCENT_CPU" option, and press Enter.
To search for a specific process, press the F3 key and enter the name of the process in the search field.
To kill a process, select it using the arrow keys and press the F9 key. Then, select the signal you want to send to the process (e.g. SIGTERM or SIGKILL) and press Enter.
To monitor a specific user's processes, press the F4 key and enter the username in the "Setup filter" field.
To change the color scheme, press the F2 key and select "Colors" from the menu. You can then select a pre-defined color scheme or customize your own.
ps
The ps
command in Linux is used to display information about the running processes on a system. It can be used to view the currently running processes, their process IDs (PIDs), and other information such as their CPU and memory usage.
Display a list of all running processes with additional information:
Display a process tree for all running processes:
Display information for a specific process ID:
Display all processes owned by a specific user:
grep
The grep
command is a command-line utility for searching for a specific pattern or regular expression in a file or output. It can be used to search for specific strings in a single file or across multiple files. The command returns the lines containing the search string and is commonly used in conjunction with other commands in a pipeline.
Search for the pattern in the specified file and displays all lines that contain the pattern.
Search for the pattern in the specified file, ignoring case sensitivity:
Search for the pattern recursively in all files within the specified directory and its subdirectories.
List all running processes and filters the output to display only the process with the specified name.
Search through the command history and displays only the commands that contain the specified name.
netstat
netstat
(network statistics) is a command-line tool used to display various information about network connections, routing tables, and network interfaces on a Linux system. It can be used to view active network connections, check listening ports, display network statistics, and monitor network activity. This information can be helpful in troubleshooting network issues, monitoring network traffic, and identifying network security threats.
Show all active network connections and the processes that are listening on those connections.
Display the kernel routing table.
Display statistics for each protocol.
Display all active network connections, both listening and non-listening.
Display all listening network connections.
Display network addresses as numbers rather than host and domain names
Display the process ID and name of the program using each network connection.
Display a continuous stream of network connection information.
ifconfig
The ifconfig
command is a network configuration tool used to display and manage network interface configuration. It shows the status of the network interfaces available on a system and can be used to configure and troubleshoot network-related problems. With the ifconfig command
, you can view the IP address, netmask, and other network-related information about each interface on the system. You can also use it to assign an IP address, enable or disable an interface, and configure other network-related settings.
To display the configuration of all network interfaces:
To display only the IP addresses of all network interfaces:
To configure a network interface with a specific IP address:
To bring up a network interface that is currently down:
To bring down a network interface:
ip
The ip
command is used for configuring and displaying network interfaces and routing tables in Linux. It is a replacement for the older ifconfig
command and provides more advanced and detailed information about network configurations. It can be used for assigning IP addresses to interfaces, setting up routes, configuring VLANs, tunnels, and bridges, and managing network namespaces.
To show the IP address of a network interface:
To set the IP address of a network interface:
To delete an IP address from a network interface:
To show the routing table:
To add a route to the routing table:
To delete a route from the routing table:
iptables
iptables
is a powerful command-line tool used to manage the Linux firewall. It allows you to set up rules and filters to control network traffic coming into and out of your system. Using iptables
, you can create rules to accept or reject traffic based on various criteria such as the source IP address, destination IP address, protocol, and port number.
Allow all incoming traffic from a specific IP address:
Block all incoming traffic from a specific IP address:
Allow all traffic to a specific port:
Block all traffic to a specific port:
Allow all traffic on the loopback interface:
Block all traffic from a specific network interface: `` bash iptables -A INPUT -i eth0 -j DROP
nftables
nftables
is a command-line utility in Linux used to manage the Netfilter firewall subsystem. It is designed to replace the previous iptables tool. It provides a simpler and more expressive syntax, improved performance, and enhanced features for managing network traffic. Using nftables
, you can configure firewall rules and filters, create network address translation (NAT) rules, and perform packet mangling. It allows you to filter and modify network packets based on various criteria such as IP addresses, ports, protocols, and packet content.
Add a rule to the filter table of nftables that allows incoming TCP traffic on port 22 (SSH) to be accepted.
List all the rules that are currently configured in the nftables ruleset.
Create a new table named nat in the nftables ruleset.
Add a new chain named prerouting to the nat table that is triggered before the routing decision is made
Add a rule to the prerouting chain that redirects incoming TCP traffic on port 80 to the IP address 192.168.1.2.
df
df
(Disk Free) is a command in Linux/Unix systems used to display the amount of available and used disk space on a file system. It provides information about the total size of a filesystem, the amount of free space available, and the amount of space used by each directory and file within that filesystem. It is often used to identify file systems that are running low on disk space.
Show the disk space usage information for all mounted file systems
Show the disk space usage information in a human-readable format (e.g. in gigabytes, megabytes, etc.)
Show the disk space usage information along with the file system type
Show the inode usage information for file systems
Shoq the disk space usage information for all file systems, including those that are not mounted yet
Shows the disk space usage information for a specific file system (in this example, /dev/sda1)
openssl
openssl
is a command-line tool used for working with secure communications over networks using SSL/TLS protocols. It provides various cryptographic functions such as generating and verifying digital signatures, creating and verifying SSL/TLS connections, generating and encrypting private keys, and more.
Generate a new private key
Generate a self-signed certificate:
Verify a certificate
Encrypt a file with a password:
Decrypt a file:
rsync
The rsync
command is used for file synchronization and transfer between multiple systems. It can transfer files over SSH or a direct network connection and is designed to be fast and efficient. The command can also perform incremental backups and only transfer the changed parts of a file, reducing network traffic and improving transfer speed.
Copy files from local to remote server:
Copy files from remote to local server:
Sync two folders on the same server:
Exclude certain files or directories:
Copy files in archive mode:
Delete files on the destination that do not exist on the source:
lsb_release
The lsb_release
command is used to obtain information about the Linux distribution release on which the system is running. It prints the LSB (Linux Standard Base) and distribution-specific information. It can be used to determine the distribution name, release number, and codename.
To display the distribution-specific information:
To display only the distribution ID:
To display only the distribution release number:
To display only the description of the distribution:
Last updated