Basic knowledge and basic operations of Ubuntu (root account, network, etc.)

​​​​​​

table of Contents

1. Basic environment

2. Basic concepts

(1) Command line

1) The meaning of the command line identifier

2) System files and file information identification

3. Common basic operations

(1) Basic information changes

(2) Open the root account

reference


 

1. Basic environment

(1) Ubuntu 18.04 (applicable to Ubuntu 16.04, 20.04 and other versions)

(2) Ubuntu uses root account (if not root account, you need to add sudo before each command)

(3) Ubuntu network is normal

2. Basic concepts

(1) Command line

1) The meaning of the command line identifier

root @ KKB : ~ # constitute Analysis:

  •        Username (@before):

                   root (the highest authority account)

                   Ordinary account

  •        System name (after @): default ubuntu
  •        The current directory (: after):

                   ~ (Relative path)

                   /xxx (absolute path)

  •        User permissions (after the current directory):

                   $ (Ordinary user)

                   #(root)

2) System files and file information identification

In the Linux system, you can view the relevant file and folder information in the current directory through ll or ls -l. The meaning of the logo is as follows:

  • Paragraph 1 (characters 1-10): file information

            The first character: the type of file

                      -: Ordinary file
                      d: Directory
                      l: Link file, similar to shortcut
                      b: Block device file
                      c: Character device file
                      p: Command pipeline file, shell related file
                      s: sock file, shell related file

            The next 9 characters: file control authority (a group of three digits, whether the first digit is readable, the second digit is written, and the third digit is executable)

                      The first three: indicate the permissions of the file owner, the
                      middle three: indicate the permissions of the group to which the file belongs, and the
                      last three: indicate the permissions of other users.
                      Permission types include:
                      r (Read): means readable
                      w (Write): means writable
                      x (eXecute): means executable
                      s (socket): means network interface
                      -means no permission

  • Paragraph 2: Identify the number of subdirectories 
  • Paragraph 3: Identify the creator of the file
  • Paragraph 4: Identify the user group of the creator
  • Section 5: Indicates the space occupied by the file (its own size, excluding sub-files)
  • Paragraph 6-8: Identify the last access time of the file
  • Paragraph 9: Identify the file name

 

3. Common basic operations

(1) Basic information changes

1) System name

1--Enter the ubuntu system configuration interface

2--Modify the system name

(3) Basic network settings

For the newly installed ubuntu, you need to download some software, so you need to ensure that the network in the system is normal, that is, the Internet is connected. If you encounter no external network, you can follow the following steps to troubleshoot and operate.

1) Whether the basic network is connected

Check whether the network of the host where ubuntu is located is normal.

2) Under the premise of ensuring 1) there is no problem, test whether ubuntu is connected to the Internet, open the command line, and enter the following command in the command line

ping 8.8.8.8

ps:

1--8.8.8.8 is an IP address, which is the IP address of a free DNS server provided by Google

2--ping is a command in Linux system, Internet packet explorer, used to test network connection

The results are generally as follows:

This situation means that the network is normal and the Internet is connected.

If the following conditions occur, it means that the network is not connected to the external network:

Phenomenon 1:

Phenomenon 2:

3) Solutions to network failure

1--Click the network icon to turn on the network

2--If there is no network icon, proceed as follows

Stop the network management service in the system first, delete the network status file, and then restart the network management service.

service NetworkManager stop
rm /var/lib/NetworkManager/NetworkManager.state
service NetworkManager start

reference

Linux command: ls -l(ll) result analysis

ubuntu some basic command line operations

Ubuntu20.04 open root account

ubuntu18 has no network connection

Guess you like

Origin blog.csdn.net/junzhu_beautifulpig/article/details/108694284