Linux Shortcut key Collection

Source: Internet
Author: User
Tags save file square root

ctrl + a  switch to the command line start this operation is the same as the home implementation, but home in some UNIX environment can not be used, it is possible to use this combination; Vim under Linux, this is also valid; In many of the Windows file editors, this is also valid. ctrl + e  switch to the end of the command line this operation is the same as the end implementation, but the end key is not available in some UNIX environments and can be used with this combination; Vim under Linux is also valid; In many of the Windows file editors, this is also valid. ctrl + l  clear the screen content, the effect is equal to  clearCtrl + u  clear the content before the cut cursor This command is useful, and is also valid in Nslookup. I sometimes see colleagues a word in a word delete shell command, very crash! In fact, it can be done with a ctrl + u. ctrl + k  cut clear the contents after the cursor ctrl + y  paste the character you just deleted this command is more powerful, the deleted character may be a few strings, but most likely a single line of command. ctrl + r  in the history command to find   (this is very useful, enter the keyword to recall the previous command) This command I strongly recommend, sometimes history more long, want to find a more complex, directly here, The shell will automatically find and invoke, conveniently ctrl + c  terminate command ctrl + d  exit shell,logoutctrl + z  Run in the background however, a process run by ctrl + z into the background will terminate after the current user exits, so use this as a nohup command &amp, because the Nohup command is the role of the user exit after the process continues to run, Many scripts and commands now require that the root exit is still valid.!!    repeat the last command history  displays all of your executed numbering + history commands. This can match! Edit to execute a command ↑ (ctrl+p)   Show previous command ↓ (CTRL + N)   Show next command!$  displays the last parameter of the system cd -     switch back to the previous directory ^foo^bar^   =  !!:s/foo/bar/       Replace a phrase in the previous command ffmpeg -f x11grab -s wxga -r 25 -i :0.0  -sameq /tmp/out.mpg    Crawl Linux Desktop video 10 You do not use the usual Linux command count 1) pgreppgrep name before a p, we can guess this is related to the process, but also grep, This is, of course, a process-related grep command. However, this command is primarily used to enumerate the process IDs. such as: $ pgrep -u hchen2244122444 This command is equivalent to:1 ps -ef | egrep  ' ^hchen '  |  awk  ' {print $2} ' 2) pstree This command lists the processes in a tree-shaped way. :[[email protected] ~]$ pstreeinit-+-acpid|-auditd-+-python|  '-{AUDITD} as shown below 3) BC This command is mainly to do a higher precision mathematical operation. such as open square root. Here is a script we wrote with the BC command (file name: sqrt) #!/bin/bashif [ $# -ne 1 ]thenecho  ' usage:  Sqrt number ' exit 1elseecho -e  "sqrt ($) \nquit\n"  | bc -q -ifi So, We can use this script to do the square root operation:[[email protected]]$ ./sqrt 36[[email protected]]$ ./sqrt  2.00001.4142[[email protected]]$ ./sqrt 10.00004) Split if you have a large file, and you want to split it into small files, then this is the order to do it. [[Email protected] applebak]# ls -l largefile.tar.gz-rw-r--r-- 1 hchen  hchen 436774774 04-17 02:00 largefile.tar.gz[[email protected] applebak]#  split -b 50m largefile.tar.gz lf_[[email protected]]# ls -l lf_* -rw-r--r-- 1 hchen hchen 52428800 05-10 18:34 lf_aa-rw-r--r-- 1  hchen hchen 52428800 05-10 18:34 lf_ab-rw-r--r-- 1 hchen hchen  52428800 05-10 18:34 lf_ac-rw-r--r-- 1 hchen hchen 52428800 05-10  18:34 lf_ad-rw-r--r-- 1 hchen hchen 52428800 05-10 18:34 lf_ Ae-rw-r--r-- 1 hchen hchen 52428800 05-10 18:35 lf_af-rw-r--r-- 1  hchen hchen 52428800 05-10 18:35&nbsp Lf_ag-rw-r--r-- 1 hchen hchen 52428800 05-10 18:35 lf_ah-rw-r--r-- 1  hchen hchen 17344374 05-10 18:35 lf_ai file merging only requires a simple merge, such as:1 [[email  protected]]# cat lf_* >largefile.tar.gz 5) The NLNL command is similar to the Cat command, except that it will hit the uplink number. As shown below: [[email protected] include]# nl stdio.h | head -n 101 /*  define iso c stdio on top of c++ iostreams.2 copyright   (C)  1991,1994-2004,2005,2006 Free Software Foundation, Inc.3 This  File is part of the gnu c library.4 the gnu c library  is free software; you can redistribute it and/or5 modify it  under the terms of the gnu lesser general public6 license  as published by the&nBsp Free software foundation; either7 version 2.1 of the license, or   (at your option)  any later version.8 the gnu c library  is distributed in the hope that it will be useful, 6) Mkfifo who is familiar with UNIX should know that this is a system call or command that creates a named pipe. Normally, we use the vertical bar "|" on the command line. To string up commands is to use a dead pipe. And we use Mkfifo to use the famous pipe. Here is an example: The following is the creation of a well-known pipe: [[email protected] ~]# mkfifo /tmp/hchenpipe[[email protected]  ~]# ls -l /tmpprw-rw-r-- 1 hchen hchen 0 05-10 18:58  hchenpipe  then, we run the following command in a shell, and this command does not return unless someone reads the message from the famous pipe. [[email protected] ~]# ls -al > /tmp/ Hchenpipe we read the information in this pipeline in another command window: (which causes the previous command to return) 01 [[email protected] ~]# head /tmp/ HCHENPIPE02&NBSP;DRWX------ 8 hchen hchen 4096 05-10 18:27 .03  drwxr-xr-x 7 root ROOT&NBSP;4096&NBSP;03-05&NBSP;00:06&NBSP, .... 04&NBSP;DRWXR-XR-X&NBSP;3&NBSP;HCHEN&NBSP;HCHEN&NBSP;4096&NBSP;03-01&NBSP;18:13&NBSP;BACKUP05&NBSP;-RW-------  1 hchen hchen 721 05-05 22:12 .bash_history06 -rw-r--r-- 1  hchen hchen 24 02-28 22:20 .bash_logout07 -rw-r--r-- 1 hchen  hchen 176 02-28 22:20 .bash_profile08 -rw-r--r-- 1 hchen hchen  124 02-28 22:20 .bashrc09 -rw-r--r-- 1 root root 14002 03-07  00:29 index.htm10 -rw-r--r-- 1 hchen hchen 31465 03-01 23:48 &NBSP;INDEX.PHP7) ldd This command lets you know that one of your executables uses a dynamic-link library. such as:01 [[email protected] ~]# ldd /usr/bin/java02 linux-gate.so.1 =>  (0x00cd9000) 03 libgij.so.7rh => /usr/lib/libgij.so.7rh  (0x00ed3000) 04  libgcj.so.7rh => /usr/lib/libgcj.so.7rh (0x00ed6000) 05 libpthread.so.0 => /lib/i686/nosegneg/libpthread.so.0  (0x00110000) 06  librt.so.1 => /lib/i686/nosegneg/librt.so.1  (0x009c8000) 07 libdl.so.2 =>  /lib/libdl.so.2  (0x008b5000) 08 libz.so.1 => /usr/lib/libz.so.1  (0x00bee000) 09 libgcc_s.so.1 => /lib/libgcc_s.so.1  (0x00aa7000) 10 libc.so.6 => / lib/i686/nosegneg/libc.so.6  (0x0022f000) 11 libm.so.6 => /lib/i686/nosegneg/libm.so.6   (0x00127000) 12 /lib/ld-linux.so.2  (0x00214000) 8) Col This command allows you to convert a man file into a plain text file. The following example: # pager=cat   # man less | col -b > less.txt    9) XMLWF This command allows you to check if an XML document is all of the tags are normal. such as:1 [[email protected] ~]# curl  ' Http://coolshell.cn/?feed=rss2 '  >  Cocre.xml2 % total % received % xferd average speed time time time current3 dload upload total spent left speed4  100 64882 0 64882 0 0 86455 0 --:--:-- --:--:-- --:--:--  2073k5 [[email protected] ~]# xmlwf cocre.xml6 [[email protected]  ~]# perl -i -pe  ' [email protected]<link>@<br>@g '  cocre.xml7  [[email protected] ~]# xmlwf cocre.xml8 cocre.xml:13:23: mismatched  TAG10) lsof can list the files that are open. 01 [[email protected] ~]# lsof | grep tcp02 httpd 548 apache  4u IPv6 14300967 TCP *:http  (LISTEN) 03 httpd 548 apache 6u  IPv6 14300972 TCP *:https  (LISTEN) 04 httpd 561 apache 4u  ipv6 14300967 tcp *:http  (LISTEN) 05 httpd 561 apache 6u ipv6  14300972 tcp *:https  (LISTEN) 06 sshd 1764 root 3u ipv6 4993 tcp  *:ssh  (LISTEN) 07 tcpserver 8965 root 3u ipv4 153795500 tcp  *:p op3  (LISTEN) 08 mysqld 10202 mysql 10u ipv4 73819697 tcp *: mysql  (LISTEN) 09 sshd 10735 root 3u ipv6 160731956 tcp  210.51.0.232:ssh->123.117.239.68:31810  (established) 10 sshd 10767 hchen 3u  ipv6 160731956 tcp 210.51.0.232:ssh->123.117.239.68:31810  (ESTABLISHED) 11 vsftpd  11095 root 3u IPv4 152157957 TCP *:ftp  (LISTEN) Appendix: Shortcuts for desktop environments under Linux the following directives are valid under Linux/unix desktop environment (GNOME), such as a discrepancy with your own server:alt + f1  like the win key under Windows, Open the Applications menu (applications) in GNOME alt + f2  win + r key combinations like windows, run applications in Gnome ctrl  + alt + d  similar to win +&nbsp under Windows;D key combination, Show desktop ctrl + alt + l  Lock desktop and start screen saver alt + tab  with alt + under Windows  tab key combination, switch between different program Windows printscreen  full Screen capture alt + printscreen  current window capture ctrl + alt +  → / ←  switching between different tables ctrl + alt + shift + → / ←  Move the current window to a different table ctrl+alt+shift+fn  terminal n or analog terminal n (N and N for digital 1-6) ctrl+alt+shift+f7  back to desktop ctrl+alt+shift+f8  Unknown (terminal or analog Terminal) window operation shortcut key alt + f4  close window alt + f5  Cancel Maximize window   (Restore window original size) alt +  f7  Mobile window   (note:  is not valid in the maximized State of the window) alt + f8  change the window size   (note:  is not valid in the maximized State of the window) alt +  F9  Minimize window alt + f10  Maximize window alt + space  Open Window Control menu   ( Click on the menu that appears in the upper-left corner of the window) in the application, these are not available for all programs under common shortcut keys. Can be compared with shortcut keys under Windows:ctrl+n  new window ctrl+x  cut ctrl+c  copy ctrl+v  paste ctrl+z  undo Previous action Ctrl+shift+z   Redo just undo step action ctrl+s  save file Browser ctrl+h  Show hidden file (toggle) ctrl+t  new label ctrl+page up  previous label Ctrl + Page Down  next tab alt+n  switch to nth label (n is number) 


This article is from the "lake and Laughter" blog, please make sure to keep this source http://hashlinux.blog.51cto.com/9647696/1763454

Linux Shortcut key Collection

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.