Linux-Ubuntu beginners—must learn commands

 

Preface

     The first thing you need to understand when you learn Linux is Linux commands. Here I have listed some commands that are commonly used in work. I hope I can help you.

 


1. Basic commands

Ctrl + AIt + T       : Call up the command port terminal (commands need to be in the command port terminal to use)

Ctrl + Shift + '+' : Enlarge the font

Ctrl + '-' : Decrease font

Ctrl + L   : Clear the screen

Ctrl + C   : Stop the current program

Ctrl + Z   : transfer the current process to the background

fg     : Resuming process (usually combined with Ctrl + Z)

ifconfig : view IP address

Tab : Auto-completion code (artifact for efficient work, you will fall in love with this key)

 


Two, commonly used commands

1. Command line mode

ls        : List which files are in the current path

pwd    : Display the current file path

cd       : Go back to your working directory (that is, the first directory you entered)

cp Dir1.c Dir2.c  : Copy the contents of DIr1.c to Dir2.c 

touch Dome1.txt   : Create a txt file called dome1.txt in the current directory

rm Dome1.txt   : delete the Dome1.txt file

mkdir  Dir1         : Create a directory called Dir1

rm Dir1              : delete the DIr1 directory

mv  Dir1.c Dir2.c  : Rename Dir1.c to Dir2.c

 

2. Input line mode

vi dome1.c : Enter vi's command line mode and create a "dome1.c" file (still in command line mode at this time)

i   : switch to input line mode (write code in input line mode)

Esc : Exit the input line mode and enter the command line mode

The following commands are entered in the command line mode and executed in the input line mode:

yy    : copy the line where the cursor is

nyy : copy the line where the cursor is located n lines down (n is an integer)

p   : lowercase p, paste the copied data on the next line of the cursor

P   : uppercase P, pasted on the line above the cursor

dd    : delete the line where the cursor is

ndd  : delete the downward n lines where the cursor is (n is an integer)

Ctrl + r : redo the last action

u    : restore the previous action

.    : Decimal point, repeat the last action

 

3. Bottom line command line mode

::      Colon means switch to bottom line input mode, input command at the bottom

:set nu   : type the line number

:wq    : exit and save (w: save q: exit)


to sum up

Proficiency in using and mastering common commands can make us do more with less and greatly improve our work efficiency. But at the end of learning, we still have to keep a curiosity. For example, what are the principles behind these commands and how are they implemented? Take these questions to explore. A qualified programmer should have a strong curiosity for new knowledge and the ability to continue learning.

Guess you like

Origin blog.csdn.net/weixin_49472648/article/details/108751833