1.2 Ubauntu use

1. Complete the VMware Tools installation

        Double-click VMwareTool

        Open Ubuntu terminal shortcut keys Alt+Control+T

        The shortcut key to switch to Chinese isAlt+空格

ls 打印出当前所在目录中所有文件和文件夹 

cd 桌面 进入桌面文件夹

sudo ./vmware-install.pl Install the tool and enter the password you set previously.

The address is default, just press Enter.

When the picture above appears, the installation is complete.

After restarting, you can directly copy and paste text, files, etc. under the virtual machine Ubuntu system and the host Windows.

If the above method doesn't work, use the following method.

Uninstall firsts udo vmware-uninstall-tools.pl

then in

Enter this path sudo apt-get install open-vm-tools-desktop

The installation is complete.

2. Using Ubuntu’s gidit

        Right-click on the template file

input the command sudo gedit 无标题文档

        If the command cannot be found, reopen a terminal and enter sudo apt-get install gedit to complete.

3. Ubuntu terminal operation (Shell)

Open terminal

luoxuesong@luoxuesong-VMware-Virtual-Platform:~$

Before @ is the user name, after @ is the author's machine name, and the last $ indicates that the current user is an ordinary user.

Shell format: command -options [argument]

command: command name

options: optional

argument: command parameter, optional or not

For example:

ls

ls -l: Print all files and folders in the current directory

ls /usr: Print out all files and folders under the directory "/usr"

        If you press Tab and the code cannot be automatically completed, there are three reasons:

        1. There is only this kind of code. For example, if I press tab and nothing is displayed, it means that there is only if command. You can add sudo apt install net-tools, and then try again and it will appear like this

        2. Not installed sudo apt-get install bash-completion, generally it is installed.

        3. If you need to change the file, enter it in the terminal sudo vi /etc/bash.bashrc

        Find this string of code, delete all the previous comments, press d+w, then press i to enter the editing mode, press space to adjust the format, ESC to exit the editing mode, each line must enter the editing mode, and exit editing model. Finally, in ESC mode, just press ESC and enter :wq  in the mode. This is to exit and save.

4. Commonly used Shell commands

1. File browsing (ls)

ls [options] [path]

ls mainly displays the contents of the specified directory. The main parameters are:

-a  : Display all files and subdirectories, including hidden files starting with ".".

-l  : Display detailed information of the file, such as file shape, permissions, owner, size and other information.

-t  : List files sorted by creation time.

-A : Same as -a, but does not list "." (current directory) and ".." (parent directory).

-R  : List all files recursively, including files in subdirectories.​ 
 

The parameters of the Shell command can be used in combination, for example:

2. Directory switching (cd)

cd  [path]

cd     //Enter the root directory "/", the root directory of the Linux system is "/"

cd / usr  //Enter the directory "/usr"

cd .     //Enter the upper level directory

cd ~    //Switch to the current user's home directory cd /usr cd .. cd ~

3. Current path (pwd)

4. Information viewing command (uname)

unname  [option]

The parameters are as follows:

-r  : List the specific kernel version number of the current system.

-s    : List system kernel names

-o  : List system information.

5. Clear the screen (clear)

Clear the contents of the terminal.

6. Switch users to execute identity commands (sudo)

sudo  [option]  [command]

The parameters are as follows:

-h h : Display help information.

-l  : List executable and unexecutable commands for the current user

-p   : Change the prompt for asking for password.

7. Add user (adduser)

adduser  [parameter]  [username]

The parameters are as follows:

-system     : Add a system user

-home DIR : DIR represents the user’s home directory path

-uid ID    : ID represents the user's uid.

ingroup GRP : Indicates the name of the group to which the user belongs

8. Delete user (deluser)

deluser [parameter] [username]

The parameters are as follows:

-system     : The user can only be deleted when he is a system user.

-remove-home : Delete the user's home directory

-remove-all-files : Delete all files related to the user

-backup     : Backup user information

9.Switch user (su)

su [options] [username]

su can directly switch the current user to the root user and obtain the highest authority of the system. However, the root permissions are too large. It is recommended to use sudo only when the root identity is used.

The parameters are as follows:

-c –command : Execute the specified command and restore the original user identity after execution.

-login    : Change the user identity and change the working directory and PATH environment variable at the same time.

-m       : Do not change the environment variables when changing the user identity

-h ˆ ˆ ˆ ˆ : Display help information

Switching from root identity is also easy, just type in the terminalsudo su 你的用户名

10. Display file contents (cat)

cat [option] [file]

Read the file in the shell.

The main parameters:

-n  : Number all output lines starting from 1

-b  : Similar to -n, but does not number blank lines

-s  : When two or more consecutive blank lines are encountered, merge them into one blank line.

 


 

11. Display and configure network properties (ifconfig)

Before this, you need to install it manually sudo apt-get install net- tools

ifconfig  interface  option|address

The main parameters:

interface : Network interface name, such as eth0 etc.

up       : Turn on the network device

down       : shut down network equipment

add     : IP address, set the network IP address

netmask add: subnet mask.

12. System help (man)

man[command name]

There are many commands in the Ubuntu system, and it is impossible to remember them all. At this time, the system provides a help manual.

Press "q" to return to the terminal

13. System restart (reboot)

14. System shutdown (poweroff)

5. Install the serial port tool minicom

sudo apt-get install package-name

apt-get: Responsible for downloading software

install: Responsible for installing software

package-name: the name of the installed software

Install serial port tools:sudo apt-get install minicom

Enter the serial port configuration interface:sudo minicom -s

For specific minicom tutorials, you can read this blog:[linux] Serial communication tool-minicom introduction + simple operation - Li Zhuming - Blog Park (cnblogs.com)

To exit minicom, just press ESC to return to the terminal.

6. VI/VIM editor

        The VIM editor is an upgraded version of the VI editor. The VI/VIM editor is a command-based editor that does not require a mouse or menu, and only uses the keyboard to complete all editing work.​ 

Install VIM editor:sudo apt-get install vim

Create a file:vim test.txt

It is impossible to input when you first use it, because VIM only reads the current document by default.

i  : Switch to input mode in front of the character where the current cursor is located.

I  : Switch to input mode at the beginning of the line where the current cursor is located.

a   : Switch to input mode after the character where the current cursor is located.

A : Switch to input mode at the end of the line where the cursor is located.

o : Create a new line below the line where the current cursor is, and switch to input mode.

O : Create a new line above the line where the cursor is currently located, and switch to input mode.

s  : Delete the character where the cursor is.

r ˜: Replace the character at the cursor.

The most commonly used is "a", then "Insert" will be displayed in the lower left corner

Commonly used VI/VIM commands:

h (or left arrow key): Move the cursor one character to the left.

l (or right arrow key): Move the cursor one character to the right.

j (or down arrow key): Move the cursor down one line.

k (or up arrow key): Move the cursor up one line.​ 

cc  : Delete the entire line and modify the content of the entire line.

dd : Delete the line, no modification function is provided.

ndd : Delete the current line n lines down.

x   : Delete the character where the cursor is.

X  : Delete the character in front of the cursor.

nyy : Copy the current line and n lines below it.

p  : Paste the recently copied content.​ 

Entering ":" will enter the underlying mode.

x  : Save the current document and exit.

q  : Exit.

w  : Save the document.

q!  : Exit VI/VIM without saving the document.

You can enter "/" in the command mode to enter the bottom mode. You can enter the specified content after / and the system will automatically search for it.
 

Guess you like

Origin blog.csdn.net/qq_45475497/article/details/134735976