Linux Shell键盘快捷键小技巧

更新时间:2023-05-21 12:27:11 阅读: 评论:0

Linux系统下Shell命令行快捷键实用技巧
2009-01-22 14:01
##注:以下字母不分大小写

# Ctrl A - Go to the beginning of the line you are currently typing on
# Ctrl E - Go to the end of the line you are currently typing on
切到命令行开始|结尾
# Ctrl xx - Move between EOL and current cursor position
光标在当前行的开头和结尾切换

# Ctrl L - Clears the Screen, similar to the clear command
清屏,类似于 clear 命令


---------------------------------------
# Ctrl U - Clears the line before the cursor position. If you are at the end of the line, clears the entire line.
清除光标以前

# Ctrl K - Clear the line after the cursor
清除光标之后的所有内容。
---------------------------------------

specification
# Ctrl H - Same as backspace
退格键 backspace


---------------------------------------
# Alt F - Move cursor forward one word on the current line
光标向前移动一个词的距离
# Alt B - Move cursor backward one word on the current line
光标向后移动一个词的距离
---------------------------------------
在图形界面下使用终端时会与Alt+F(打开file菜单)冲突,可以在 keyboard Shortcuts选项中禁用file菜单项,即 (x)Disable all menu access keys(such as Alt+f to open File menu)
这样就可以用shell自身的shortcuts了。


# Ctrl R - Let’s you arch through previously ud commands
从命令历史中找


# Ctrl C - Kill whatever you are running
终止命令


# Ctrl D - Exit the current shell
退出 shell


# Ctrl Z - Puts whatever you are running into a suspended background process. fg restores it.
这个指你想中断一下当前执行的程序,但又不想杀死它,可以把它放到后台,想继续执行时,用fg可以唤醒它。

eg:
[test@localhost hyang0]$ du -sh autorun/

[2]+ Stopped                du -sh autorun/
[test@localhost hyang0]$ su root
Password:
[root@localhost hyang0]# ifconfig
eth0      Link encap:Ethernet HWaddr 00:0C:29:45:58:3E
          inet addr:128.224.158.134 Bcast:128.224.159.255 Mask:255.255.254.0
          inet6 addr: fe80::20c:29ff:fe45:583e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:145934400 errors:3054 dropped:5782 overruns:0 frame:0
          TX packets:158380695 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4270079759 (3.9 GiB) TX bytes:1002567064 (956.1 MiB)
历年英语六级听力下载          Interrupt:59 Ba address:0x2000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0costume是什么意思
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:2202 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2202 errors:0 dropped:0 overruns:0 carrier:0
chaintech          collisions:0 txqueuelen:0
          RX bytes:3258635 (3.1 MiB) TX bytes:3258635 (3.1 MiB)

[root@localhost hyang0]# exit
exit
[test@localhost hyang0]$ fg
du -sh autorun/


---------------------------------------unesco是什么意思的缩写
# Ctrl W - Delete the word before the cursor
清除光标之前的一个词,一般是以空格格开,不会删一行。

# Alt d - Delete word
向后删一个词grades
---------------------------------------------


# Ctrl T - Swap the last two characters before the cursor
交换光标前的最后两个字符

# Esc T - Swap the last two words before the cursor
talented交换光标前的最后两个单词


# Tab - Auto-complete files and folder names
自动补全


# Ctrl Y - to paste it (as in delete and copy) all text in front of the cursor
粘贴(刚才 ctrl w 或者 ctrl k 的内容)


# Esc . (or Esc Underscore) - Inrt Last Argument
插入最后一个参数,
比如我 运行 cd /
那么我执行 Esc . ”, 就会插入 "/ " 这个参数

-------------------------------------energy
# Ctrl b - Move back a character
# Ctrl f - Move forward a character
将光标向前|后移动一个字母的距离,不改变任何东西。
powerful--------------------------------------



# Ctrl x @ - Show possible hostname completions


# Alt


# Alt > - Move to the last line in the history


# Alt ? - Show current completion list

cd4
# Alt * - Inrt all possible completions


# Alt / - Attempt to complete filename


# Alt . - Yank last argument to previous command


# Alt c - Capitalize the word



# Alt l - Make word lowerca


# Alt n - Search the history forwards non-incremental


# Alt p - Search the history backwards non-incremental


# Alt r - Recall command


# Alt t - Move words around


# Alt u - Make word upperca


# Alt back-space - Delete backward from cursor


# Here "2T" means Press TAB twice


# $ 2T - All available commands(common)


# $ (string) 2T - All available commands starting with (string)


# $ /2T - Entire directory structure including Hidden one


# $ 2T - Only Sub Dirs inside including Hidden one


# $ *2T - Only Sub Dirs inside without Hidden one


# $ ~2T - All Prent Urs on system from "/etc/passwd"


# $ $2T - All Sys variables


# $ @2T - Entries from "/etc/hosts"


# $ =2T - Output like ls or dir

本文发布于:2023-05-21 12:27:11,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/117051.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:光标   移动   结尾
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图