Linux command learning tutorial [recommended collection]

Baiyun eats spicy strips 2021-09-15 10:30:47

Hello everyone , I'm spicy . 

Catalog

One 、 operating system

Two 、 Virtual machine software

3、 ... and 、Ubuntu operating system

Four 、Linux Kernel and distribution

5、 ... and 、 View directory commands

6、 ... and 、 Switch directory command

7、 ... and 、 Absolute path and relative path

8、 ... and 、 establish 、 Delete file and directory command

Nine 、 Copy 、 Move file and directory command

Ten 、 Composition of terminal command format

11、 ... and 、 View command help

Twelve 、ls Command options

13、 ... and 、mkdir and rm Command options

fourteen 、cp and mv Command options

15、 ... and 、 Redirect command

sixteen 、 View file content command

nineteen 、 Find file command

twenty 、 Compression and decompression commands

The 21st 、 File permission command

Twenty-two 、 Commands for obtaining administrator privileges

twenty-five 、 Remote login 、 Remote copy command

hexacosa- 、 Editor vim

twenty-seven 、 Software installation

Twenty-eight 、 Software uninstall


One 、 operating system


1. Common operating systems

  • Windows
  • mac OS
  • Linux
  • iOS
  • Android

2. The definition of operating system

The operating system runs directly on the computer Systems software , It is Computer programs that control hardware and support software operation .

 

3. The role of the operating system

Down Control hardware Up Support the operation of software , It has the function of connecting the preceding and the following .

 

4. Summary

An operating system is a computer program that controls hardware and supports software , Only computers with an operating system installed can work properly .

 

Two 、 Virtual machine software


1. Introduction to virtual machine software

It is a software that can virtual out a computer .

Common virtual machine software :

  • Vmware
  • VirtualBox

explain :

The virtual machine can be created only after the virtual machine software is installed , Of course, you can also create multiple virtual machines through virtual machine software .

2. Introduction to virtual machine

Is to simulate a real computer , Like a virtual computer , For fast learning, a new operating system can be completed through virtual machine .

 

Virtual machines are independent of each other , Deleting a virtual machine will not affect other virtual machines , Of course, it will not affect the computer itself

3. Installation instructions of virtual machine software

  • Windows and Linux download VMware Workstation Version of the installation package
  • mac OS download VMware Fusion Version of the installation package
  • When the corresponding installation package is downloaded, double-click to install it
  • When the virtual machine software is successfully installed, you can create a virtual machine

 

4. Summary

  • Corresponding to fast learning a new operating system , We can use virtual machines to complete .
  • Virtual machine software 、 virtual machine 、 The operating system and the relationship between them :

     

 

3、 ... and 、Ubuntu operating system


1. Ubuntu Introduction to the operating system

Ubuntu The operating system belongs to Linux One of the operating systems , It's free 、 A stable operating system with a gorgeous interface

2. Ubuntu Introduction to graphical interface

  • The task bar

  • Window operation button

  • Window menu bar

 

3. And Windows Directory structure comparison

 

Each drive letter is a root directory , stay Windows Multiple root directories may appear in the operating system .

 

Ubuntu There is no concept of drive letter , There is only one root / .

 

Description of the main contents :

  • /: root directory
  • /bin: Directory of executable binaries
  • /etc: Directory where system configuration files are stored
  • /home: User home directory

4. And Windows Window comparison

 

Window comparison description :

  • Windows The window operation button is on the left side of the window
  • Linux The window operation button is on the right side of the window

5. Summary

  • Ubuntu The operating system belongs to Linux One of the operating systems
  • Ubuntu The menu bar of the operating system window will be hidden , Moving the mouse will show , and Windows The window menu bar of the operating system will not be hidden .
  • Windows The operating system may have multiple drive letters (C、D、E、F)
  • Ubuntu The operating system does not have multiple drive letters , There is only one root (/)
  • Ubuntu The operating system is better than Windows The operating system runs more stably .

 

Four 、Linux Kernel and distribution


1. Linux kernel

Linux The kernel is inside the operating system The core program for operating and controlling hardware equipment , It was made by the Finns Linnaeus Developed .

 

The real operation and control hardware is done by the kernel , The operating system is developed based on the kernel .

2. Linux Distribution version

yes Linux The combination of kernel and various common software products , Generally speaking, it is what we often say Linux operating system .

frequently-used Linux Distribution version :

  • Ubuntu
  • CentOS
  • Redhat

 

3. Summary

  • Linux The kernel is Linux The operating system is the core program for managing hardware devices
  • frequently-used Linux Operating systems are based on Linux Developed by the kernel

 

5、 ... and 、 View directory commands


1. View the use of directory commands

command explain
ls View current catalog information
tree Display directory information in a tree

 

2. View the current directory path

command explain
pwd View the current directory path

 

3. Clear terminal content

command explain
clear Clear terminal content

4. Summary

  • ls and tree It is the most common command for us to view directory information
  • ls Only one layer of directory information can be viewed
  • tree You can view multi-level directory information .

 

6、 ... and 、 Switch directory command


1. Use of the switch directory command

command explain
cd Catalog Switch to the specified directory
cd ~ Switch to the current user's home directory
cd .. Switch to the previous Directory
cd . Switch to current directory
cd - Switch to the last Directory

Be careful :

  • cd Command to switch directories , This directory must exist .
  • cd Not writing the following directory is equivalent to cd ~

 

2. Summary

  • cd The command is to complete the directory switching operation , When switching directories , This directory must exist .

 

7、 ... and 、 Absolute path and relative path


1. Absolute path

The path from the root directory is called the absolute path

for example :

  • /home/python/Desktop
  • /usr/bin

2. Relative paths

The path from the current directory is called the relative path

for example :

  • ./test/hello
  • ../static/images

3. Use of absolute and relative paths

  1. Use the absolute path to switch to the desktop
    cd /home/python/Desktop

  2. In the download directory, switch to the desktop with a relative path
    cd Downloads
    cd ../Desktop

  3. Use relative paths on the desktop to switch to the upper directory of the upper directory cd Desktop cd ../../

4. Automatic completion

  • When knocked out File or directory or command After the first few letters of , Press down tab key , If the input is unambiguous , The system will automatically complete
  • When switching directories or using commands , If you are not sure which subdirectories or other commands are in the current directory , Can pass twice tab Key view

5. Summary

  • Absolute path and relative path are two forms of path , The principle of shortest path should be followed ( Use the shortest path to manipulate a file or directory ).
    • If the switched directory is close to the current directory, you can use the relative path
    • If the switched directory is close to the root directory, you can use the absolute path
    • If the switched directory is the same as the root directory and the current directory, use the absolute path , Because the path is clear and clear , Easy to read .

8、 ... and 、 establish 、 Delete file and directory command


1. establish 、 Use of delete file and directory command

command explain
touch file name Create the specified file
mkdir Directory name Create directory ( Folder )
rm File name or directory name Delete the specified file or directory
rmdir Directory name Delete empty directory

explain :

 

rm The command needs to add... If you want to delete the directory -r Options ,-r Indicates that the directory and its contents are deleted recursively

 

2. Summary

  • touch Means to create a file
  • mkdir Means create directory
  • rm Means to delete a file or directory , If you delete a directory, you need to use -r Options ,-r Indicates that the directory and its contents are deleted recursively
  • rmdir Indicates deleting an empty directory

 

Nine 、 Copy 、 Move file and directory command


1. Copy 、 Use of the move files and directories command

command explain
cp Copy files 、 replica catalog
mv Moving files 、 Mobile directory 、 rename

explain :

 

  • To copy a directory, you need to add -r Options ,-r Represents a recursive copy of a directory and its contents

 

2. Summary

  • cp: To copy a directory, you need to add –r Options
  • mv: There is no need to add an option to move the directory
  • mv: The command can also rename files and directories

 

Ten 、 Composition of terminal command format


1. Terminal command format description

command [-options] [parameter]

Description of each item of information :

  • command: Command name , such as : ls、pwd
  • [-options]: Options , There can be zero 、 One or more options , Multiple options can be combined , For example, the -r It's options .
  • [parameter]: Parameters , There can be zero 、 One perhaps Multiple parameters , such as : touch file name 、mkdir Directory name 、cd Target directory ( route ), These file names and directory names are parameters .
  • []: For optional

2. Summary

  • Terminal command complete format : Command name Options ( Optional ) Parameters ( Optional )
  • Options : Functions for adjusting commands , such as :-r Option adjustment cp Command functionality .
  • Options can be divided into short options and long options
    1. Format of short options : '-' Followed by a single letter , such as :-r
    2. Format of long options : '--' Followed by the word , such as :--help
  • Parameters : The operation object of the command , Usually the file name or directory name .
  • For the command , Its options and parameters generally have no sequence requirements , however scp The command must be followed by options and then parameters .

11、 ... and 、 View command help


1. View the command help method

  • --help Instructions : command --help
  • man Instructions : man command

View the purpose of the command help :

  • The purpose of view command help is to view the information of command options

 

man Description of the order :

Operation key explain
Space Display the next screen information
enter Display the next line of information
b Display the previous screen information
f Display the next screen information
q sign out

2. Summary

  • --help and man There are two ways to view command help , It is mainly used to view the option information corresponding to the command

 

Twelve 、ls Command options


1. ls Command options use

Command options explain
-l Show... In a list
-h Piece size units are displayed , The default is bytes
-a Show hidden files and hidden directories

 

2. Summary

  • ls Different options will show different ways , among -l and -a Options are most commonly used

 

13、 ... and 、mkdir and rm Command options


1. mkdir Command options

Command options explain
-p Create a dependent folder

 

2. rm Command options

Command options explain
-i Interactive tips
-r Recursively delete directory and its contents
-f Mandatory deletion , Ignore nonexistent files , No need to prompt
-d Delete empty directory

 

3. Summary

  • Create nested folders using  “mkdir –p”  Nested directory
  • Delete an empty directory and use  “rmdir Directory name ”  perhaps  “rm –d Directory name ”
  • Delete non empty directory use  “rm –r Directory name ”

fourteen 、cp and mv Command options


1. cp Command options

Command options explain
-i Interactive tips
-r Recursively copy directories and their contents
-v Displays the copied path description
-a Keep the original permissions of the file

 

-a Option description :

  • -a Option also supports copying folders without losing file permissions in the folder

2. mv Command options

Command options explain
-i Interactive tips
-v Displays the path description after the move

 

3. Summary

  • Copy files to prevent overwriting  “cp –i”  operation
  • Copy folders using  “cp –r”  operation , Copy folders without losing file permissions  “cp –a”  operation .
  • Move files to prevent overwriting  “mv –i”  operation
  • Move folders and use them directly  “mv”  that will do ,“mv”  You can also rename files and folders .

15、 ... and 、 Redirect command


1. Introduction to redirection command

Redirection is also called output redirection , Save the result of executing the command at the terminal to the target file .

2. Use of redirection commands

command explain
> If the file exists, it will overwrite the contents of the original file , Equivalent to... In file operation ‘w’ Pattern
>> If the file exists, it will be appended to the end of the file , Equivalent to... In file operation ‘a’ Pattern

 

 

explain :

Redirection can be used as long as the command that can display information on the terminal , such as : tree

3. Summary

  • There are two ways to save terminal content to a file using redirection : >  and  >>
  • >  Indicates that only the latest data is written at a time , The original data is not retained .
  • >>  Indicates that the original data is added every time , The original data will be retained .

 

sixteen 、 View file content command


1. Use of the view file content command

command explain
cat View small files
more Split screen view of large files

 

explain :

  • cat Command combined with redirection can complete the merging of multiple files
  • gedit File editing command , You can view and edit files

When the viewing content information is too long to be displayed on one screen , have access to more The command allocates the contents of the display file at the terminal .

 

Operation key description :

Operation key explain
Space Display the next screen information
enter Display the next line of information
b Display the previous screen information
f Display the next screen information
q sign out

2. The Conduit (|) Use of commands

The Conduit (|): The output of one command can be used as the input of another through the pipeline , It can be understood as a container , Content stored in the terminal display .

 

explain :

The Conduit (|) General combination more Command to use , It is mainly used to allocate and view the display content of the terminal .

3. Summary

  • View small files using  cat  command
  • Split screen view of large files  more  command ,
  • View the content displayed on the terminal and display it in separate screens , Use   The Conduit (|)  combination  more  command .

 

seventeen 、 Link command


The link command is to create a linked file , Linked files are divided into :

  • Soft link
  • Hard links
command explain
ln -s Create soft link
ln Create a hard link

Be similar to Windows Next shortcut , When the directory level of a source file is deep , We want to make it easy to use. We can create a soft link to the source file .

Be careful :

  • If the soft link and the source file are not in the same directory , Use absolute path for source file , You can't use relative paths .
  • If the source file is deleted, the soft link becomes invalid
  • You can create soft links to directories
  • The function of soft link is to facilitate quick access to files , such as : Create a soft link to a file in a complex path , After that, you can complete the quick access operation through the soft link .
  • Create soft link command format : ln -s Source file path ( Using absolute paths ) Soft link

Be similar to An alias for the source file , In other words, these two names refer to the same file data .

 

Be careful :

  • Create hard links using both relative and absolute paths
  • Delete source file , Hard links can also access data .
  • Create a hard link , The number of hard links will increase 1, Delete source files or hard links , The number of hard links will decrease 1.
  • Create soft link , The number of hard links will not increase 1
  • Cannot create hard links to directories

Hard link number :

The number of hard links is the number of times the file data is used by the file name , Like reference counting

  • The function of hard link is to create hard links for important files , It can prevent file data from being deleted by mistake .
  • Delete source file , Soft link failure , But hard links can still be used .
  • Create hard link command format : ln Source file path Hard links

 

eighteen 、 Text search command


1. grep Use of commands

command explain
grep Text search

 

2. grep Use of command options

Command options explain
-i Ignore case
-n Show matching line numbers
-v Display does not contain matching text of all lines

 

3. grep Command combined with the use of regular expressions

Regular expressions explain
^ Starts with the specified string
$ Ends with the specified string
. Match a non newline character

 

4. Expand

  • grep  The command can also search the contents of the text pipeline , such as : ls / | grep ‘lib’
  • In the use of  grep  Command can also omit the quotation marks of the search content , such as : ls / | grep libgrep hello 1.txt

5. Summary

  • grep The command is to complete the text search operation
  • Command format for text search : grep Options Text search content

 

nineteen 、 Find file command


1. find Use of commands and options

command explain
find Find the file in the specified directory ( Including directory )

find Command options :

Options explain
-name According to the file name ( Include directory name ) Word search

 

2. find Command combined with wildcard

wildcard :

Is a special statement , It has an asterisk (*) And question mark (?), Used to blur search files

wildcard explain
* representative 0 Any character or characters
 
? Represents any character

 

Expand :

Wildcards can not only combine  find  Command to use , It can also be used in conjunction with other commands , such as : ls、mv、cp  etc. , It should be noted here that only  find The command uses wildcard characters and requires quotation marks .

 

3. Summary

  • find Command is to complete the operation of finding files
  • Find the command format of the file : find Specify the search directory -name " file name "

 

twenty 、 Compression and decompression commands


1. Introduction to compression format

Linux The default supported compression format :

  • .gz
  • .bz2
  • .zip

explain :

  • .gz and .bz2 Your compressed package needs to use tar Command to compress and decompress
  • .zip Your compressed package needs to use zip Command to compress , Use unzip Command to extract

Compression purpose :

  • Save disk space

2. tar Use of commands and options

command explain
tar Compression and decompression commands

tar Command options :

Options explain
-c Create package file
-v Display the details of packaging or unpacking
-f Specify the file name , Must be placed after all options
-z Compress or decompress (.gz)
-j Compress or decompress (.bz2)
-x Unpack
-C Extract to the specified directory

 

3. zip and unzip Use of commands and options

command explain
zip Compressed into .zip Format file
unzip decompression .zip Format file

unzip Command options :

Options explain
-d Extract to the specified directory

 

explain :

  • Compressed files should be used as much as possible .gz Format , Because it takes up less space
  • Use zip The compressed file takes up more space , It was quite common at that time , It's easier to operate .

4. Summary

  • .gz and .bz2 Compressed files using tar Command to complete compression and decompression
  • .zip Compressed files using zip and unzip Command to complete compression and decompression

 

The 21st 、 File permission command


1. chmod Introduction to the order

command explain
chmod Modify file permissions

chmod There are two ways to modify file permissions :

  • Alphabet
  • Digital method

2. chmod The use of alphabet

Role description :

role explain
u user, Represents the owner of the file
g group, Represents a user group
o other, Means other users
a all, Represents all users

Permission setting description :

The operator explain
+ Increase the permissions
- Revoke authority
= Set the permissions

Permission specification :

jurisdiction explain
r Can be read
w Can write
x Executable
- No authority

 

3. chmod The use of numerical methods

The number method is “rwx” These permissions can also be used Numbers instead

Permission specification :

jurisdiction explain
r Can be read , The permission value is 4
 
w Can write , The permission value is 2
x Executable , The permission value is 1
- No authority , The permission value is 0

 

4. Summary

  • utilize  chmod  Command can control the operation permission of the file .
  • Alphabetic format : chmod Permissions set by different roles file
  • Digital format : chmod Permission values of different roles file name

Twenty-two 、 Commands for obtaining administrator privileges


1. sudo Use of commands

command explain
sudo -s Switch to root user , Get administrator privileges
sudo The execution of a command requires administrator permission. You can add... Before the execution of the command sudo

 

explain :

  • If only one operation requires administrator permission, it is recommended to use sudo , That is, temporarily use manager permissions .
  • If a large number of operations require administrator privileges sudo –s, However, the operation needs to be cautious .

2. whoami Use of commands

command explain
whoami View the current user limit

 

3. exit Use of commands

command explain
exit Logout user

 

explain :

  • If it is the login user after switching , Exit will return to the last login account .
  • If it's a terminal interface , Exit the current terminal .

4. who Use of commands

command explain
who See all the login users

 

5. passwd Use of commands

command explain
passwd Change user password , Do not specify a user. Change the password of the current login user by default

 

6. which Use of commands

command explain
which Check the command location

 

7. Use of shutdown and restart commands

command explain
shutdown –h now Turn off immediately.
reboot restart

8. Summary

  • sudo Is to temporarily obtain administrator privileges
  • sudo -s Yes, switch to the administrator user , Always use administrator privileges , Caution is required .
  • exit Yes, exit the current user
  • passwd Modify the current user password by default

 

23 、 User related operations


1. Create user

command explain
useradd establish ( add to ) user

useradd Command options :

Options explain
-m Create user home directory automatically , The name of the home directory is the user name
-g Specify the user group to which the user belongs , By default, a user group with the same name will be created automatically

explain :

  • useradd  The use of commands requires administrator privileges , We need to add  sudo
  • Create users without specifying user groups , By default, a user group with the same name will be created automatically
  • See if the user created successfully , You can see /etc/passwd This file
  • See if the user group was created successfully , You can see /etc/group This file

passwd Description of each information in the document , With root:x:0:0:root:/root:/bin/bash For example :

  • first : user name
  • the second : Password placeholder
  • Third :uid, user id
  • The fourth one :gid, User group id
  • The fifth one : User description , Optional ,
  • Sixth : The location of the user's home directory
  • Seventh : Used by users shell The type of , Generally by bash perhaps sh, The default setting is sh type

group Description of each information in the document , With laowang:x:1001: For example :

  • first : User group name
  • the second : User group password placeholder , commonly Linux There is no password in the user group of the system
  • Third : Group id

id Command to view user information :

command explain
id View user information

Description of each item of information :

uid=1001(laowang) gid=1001(laowang) Group =1001(laowang)

  • first : uid Represent user id
  • the second : gid Represents a user group id
  • Third : Group Indicates the user group of the user

2. Set the password

Set passwords for other users , Need to use : sudo passwd user name

3. Switching users

command explain
su Switching users

Grammar format : su - user name

 

terms of settlement :

  • to laowang The user sets a sudo Additional group , Need to use usermod Modify user information

4. Modify user information

command explain
usermod Modify user information

usermod Options :

command explain
-G Set up an additional group
-g Modify user groups

 

5. Expand : Delete additional groups

command explain
gpasswd Add and remove additional group information

gpasswd Command options :

Options explain
-a user name Add additional groups to users
-d user name Delete additional groups for users

 

5. Delete user

command explain
userdel Delete user

userdel Command options :

Options explain
-r user name Delete user home directory , You have to set , Otherwise, the user's home directory will not be deleted

 

explain :

  • Delete user , The default user group with the same name will also be deleted

6. Summary

  • Create user command format : sudo useradd -m user name , By default, a user group with the same name will be created .
  • View user information using  id  Order or  /etc/passwd file
  • View user group information using  /etc/group file
  • Set the password for the user  sudo passwd user name
  • Switch users to  su - user name
  • Set up additional groups to use  sudo usermod -G  Group name user name
  • Delete user use  sudo userdel -r user name , The user group with the same name will be deleted by default .

Twenty-four 、 User group related operations


1. Create user group

command explain
groupadd establish ( add to ) User group

 

2. Create users and specify user groups

 

3. Modify user groups

 

4. Delete user group

command explain
groupdel Delete user group

 

explain :

  • If there are users under the user group, delete the user first before deleting the user group

5. Summary

  • Create user groups using : sudo groupadd User group name
  • Create users and specify user groups to use : sudo useradd -m -g User group user name
  • Modify user group usage : sudo usermod -g User group user name
  • Delete user group using : sudo groupdel User group name

 

twenty-five 、 Remote login 、 Remote copy command

 

1. Remote login 、 Introduction to remote copy command

command explain
ssh Remote login
scp Remote copy

2. ssh Use of commands

ssh It is a security protocol specially provided for remote login , Often used for remote login , Want to use ssh service , You need to install the corresponding server and client software , When the software is installed successfully, you can use ssh The command , In the future, remote servers can be operated through remote login .

 

Software installation steps :

  1. If Ubuntu As a server , Need to install ssh Server software . Carry out orders : sudo apt-get install openssh-server
  2. If the client computer is  macOS  The system does not need to be installed ssh Client software , By default, it has been installed , Directly available ssh command
  3. If the client computer is Windows The system needs to be installed OpenSSH for Windows This software

ssh Command format :

ssh user name @ip Address

 

explain :

  • You can install... On one computer ssh Client and ssh Server software
  • stay Ubuntu install ssh Client commands : sudo apt-get install openssh-client

3. scp Use of commands

scp Is based on ssh Command for remote file copy , In other words, it is necessary to ensure that the server and client computers are installed with corresponding ssh Software , In the future, we can remotely copy the code we write to the server .

scp Command format :

  • Copy files remotely
    • scp Local files Remote server user name @ remote server ip Address : Specify the path to copy to the remote server
    • scp Remote server user name @ remote server ip Address : Remote server files Specify the path to copy to the local computer
  • Remote copy destination
    • scp -r Local directory Remote server user name @ remote server ip Address : Specify the path to copy to the remote server
    • scp -r Remote server user name @ remote server ip Address : Remote server directory Specify the path to copy to the local computer
    • -r Represents a recursive copy of the entire directory

 

 

4. FileZilla Use of software

FileZilla It's a free and open source FTP Software , Upload and download files visually . You can go through FileZilla Instead of  scp  command

5. Summary

  • ssh The command is to log in to the host computer remotely , The equivalent of direct operation is a remote computer .
  • scp The command can complete the remote copy operation , Be careful : Copy folders need to be added -r Options .
  • A large number of files can be uploaded and downloaded through visualization tools FileZilla To complete .

hexacosa- 、 Editor vim


1. vim Introduction to

vim Is a powerful text editor , Also in the early years Vi Enhanced version of the editor , Its biggest feature is editing with commands , Completely out of the operation of the mouse .

2. vim Working mode of

  • Command mode
  • Edit mode
  • Last row mode

explain :

vim Open the file and enter the command mode

 

Be careful :

You cannot directly switch between edit mode and last line mode , All need to be done through command mode .

3. vim Last line mode command

  • :w preservation
  • :wq Save and exit
  • :x Save and exit
  • :q! Forced exit

4. vim Common commands

command explain
yy Copy the line where the cursor is
p Paste
dd Delete / Cut the current line
V Select by row
u revoke
ctr+r Counter cancellation
>> Indent right
<< Indent left
:/ Search content Search for specified content
:%s/ What to replace / Content after replacement /g Global replacement
: Start with lines , Number of end lines s/ What to replace / Content after replacement Local substitution
. Repeat the last command operation
G Back to the last line
gg Back to the first line
Numbers +G Go back to the specified line
shift+6 Go back to the beginning of the current line
shift+4 Return to the end of the current line
ctr+f Next screen
ctr+b The last screen

5. Summary

vim Is a powerful command text editor , You can modify the code of the remote server directly , This operation is faster and more convenient .

 

twenty-seven 、 Software installation


1. Introduction to software installation

Ubuntu There are two ways to install software :

  • Offline installation (deb File format installation )
  • Online installation (apt-get Way to install )

2. deb File format installation

yes Ubuntu Installation package format for , have access to  dpkg  Command to install and uninstall the software .

command explain
dpkg load and unload deb Installation package

dpkg Command options :

Options explain
-i Offline installation deb Installation package

 

3. apt-get Way to install

It's an online installation deb The command of the software package , It is mainly used online from the software warehouse of the Internet Search for 、 install 、 upgrade 、 uninstall Software .

Online installation software command format :

  • sudo apt–get install Installation package  , Indicates online installation deb Installation package

4. Change mirror source

Because use apt-get The default command is to download and install software from foreign servers , It will cause slow download and installation , Therefore, it is necessary to change to the domestic image source server .

Image source description :

The image source is the server from which the software is downloaded .

 

Change how you mirror the source :

  1. Change the mirror source visually
  2. Manually change the mirror source

explain :

  1. Manually modify the mirror source , After the configuration is completed, you need to execute  sudo apt-get update  This command , Update the image source to ensure that you can download the latest software .
  2. Use apt-get The way to install software must be networked

5. Summary

  1. Ubuntu There are two ways to install software for the operating system :
    • sudo dpkg -i Installation package   command
    • sudo apt-get install Installation package   Command uninstall
  2. Use  apt-get  Command, that is, online installation requires changing the image source , Improve download and installation speed .

 

Twenty-eight 、 Software uninstall


1. Introduction to software uninstallation

Ubuntu There are two ways to uninstall software :

  • Uninstallation of offline installation package (deb File format uninstall )
  • Uninstall the online installation package (apt-get Mode unload )

2. deb File format uninstall

Command format :

sudo dpkg –r Installation package name

-r Option indicates the uninstallation of the installation

 

3. apt-get Mode unload

Command format :

sudo apt-get remove Installation package name

 

4. Summary

  • Ubuntu There are two ways to uninstall software from the operating system :
    • dpkg -r Installation package   command
    • apt-get remove Installation package   Command uninstall

 

Industry information : Pay attention and get PPT Templates 、 The resume template 、 Industry classics PDF.
Interview question bank : Contributed by the small partners in the technology group , Hot big factory interview questions , Ongoing update .
Learning materials : Including programming language 、 Algorithm 、 Big data ecosystem components (Mysql、Hive、Spark、Flink)

Please bring the original link to reprint ,thank
Similar articles

2021-07-21

2021-07-21

2021-08-08