How to use nano under Linux, the shortcut key command of nano, what is ^, what is M

How to use nano under Linux

insert image description here

cd 桌面
ls
touch test.txt
ls
sudo nano test.txt

The above command is:

  1. switch to desktop
  2. Print the names of folders and files on the desktop
  3. Create a file called test.txt
  4. Print the names of folders and files on the desktop
  5. Open test.txt with nano as an administrator

paste

To paste in nano, it is recommended to use the right mouse button and press twice or the following P to paste.
insert image description here

What should I do after I finish writing?

After writing the file to be modified and written, press ctrl+O, Enter, Ctrl+x, (write, enter a new file name, exit) to save and exit the nano editor.

Use the mouse to modify the cursor in nano (the one that flickers in the input box is called the cursor)

You can use ctrl+cto find the current location, ctrl+/and then enter the line number to jump

nano shortcut command

Commonly used command
buffer: the buffer is a space of nano, when using copy and cut, the content will be written to the buffer, but the text copied from outside will not be copied to the buffer of nano, you need to use the right mouse button to paste

alt+u 撤销 
alt+6 复制并写入缓冲区
ctrl+o 写入文件
ctrl+x 退出
ctrl+k 剪切一行并写入缓冲区
ctrl+w 搜索
ctrl+u 粘贴缓冲区内容
多行删除 和Windows一样多选行然后 `ctrl+K` 多行删除,但是会将内容写到缓冲区
alt+a 设定标记位置,然后按方向箭头也可以多行选择

^ is ctrl

M is for Alt

Guess you like

Origin blog.csdn.net/GoodCooking/article/details/129483802