Linux + shell bash/SH/KSh/CSH/tcsh

Source: Internet
Author: User
Tags binary to decimal posix automake
Document directory
  • From Ubuntu Chinese

RedHat gnome terminal shortcut

Http://huangchao200701.javaeye.com/blog/263002

 

 

Common
Win + n switch Background Color Style
Alt + TAB = needless to say.
Win + TAB switch if 3D effect is enabled
CTRL + ALT + backspace = is equivalent to force logout
CTRL + ALT + DEL = bring up the shutdown menu
CTRL + ALT + L = locked Desktop

CTRL + ALT + D = minimize all gnome windows
CTRL + ALT + F2 = Linux end user (Alt + F7 returns xwindows, ALT + <-or-> for terminal switching)
CTRL + ALT + <-or-> = switch Desktop

Terminal shortcut
Tab = completion
CTRL + A = start position
CTRL + E = last position
CTRL + k = delete all content from here to the end
CTRL + u = delete all content from here to start
CTRL + D = Delete the current letter
CTRL + W = Delete the word from here to the left
CTRL + y = paste the words deleted by Ctrl + u, CTRL + D, CTRL + W
CTRL + R = testing. I haven't figured it out yet.
CTRL + L = equivalent to clear
CTRL + B = move back
CTRL + F = move forward
CTRL + P = display the cache command up
CTRL + n = show down the cache command
CTRL + D = close the terminal
Shift + top or bottom = terminal scroll up and down
Shift + pgup or pgdown = terminal page turning and scrolling
CTRL + Shift + F = full screen (konsole only)
CTRL + Shift + n = new terminal (terminal and konsole are different)
CTRL + c = terminate

The following is a list of shortcut keys on the Internet.

Open Main Menu = Alt + F1
Run = Alt + F2
Show desktop = CTRL + ALT + d
Minimize current window = Alt + F9
Maximize current window = Alt + F10
Close current window = Alt + F4
Capture full screen = Print Screen
Truncate window = Alt + Print Screen

Default special shortcut key
Show all window Programs = F10
Display the top program of the current window = F11
Show all programs in the current window = F12
Switch window = Alt + Tab
Rotate the 3D desktop = CTRL + ALT + left/right arrow (you can also place the mouse in the title bar or switch using the scroll wheel on the desktop)
Rotate the 3D desktop (the activity window follows) = Ctrl + Shift + ALT + left/right arrow
Manually rotate the 3D desktop = CTRL + ALT + Left click and drag the blank area on the desktop
Window Transparency/opacity = possible with the "transset" utility or Alt + scroll wheel
Zoom in once = super key + right-click
Manual zoom in = super key + scroll up
Manually zoom out = super key + scroll down
Move window = Alt + Left click
Hold the border when moving the window = left click to start dragging and then CTRL + ALT
Adjust window size = Alt + medium click
Bring up the window below the top window = Alt + middle-click
Dynamic Effect deceleration = Shift + F10
Water print = press Ctrl + super key
Rain = Shift-F9
Desktop expansion = CTRL + ALT + down arrow, then press CTRL + ALT and left/right arrow to select Desktop

 

Shell

Http://baike.baidu.com/view/849.htm

In computer science, Shell, commonly known as shell, is a software (command parser) that provides user interfaces ).

It is similar to command.com in DOS.

It receives user commands and calls corresponding applications.

It is also a programming language.

As a command language, it interactively interprets and executes user-entered commands or automatically interprets and executes a set series of commands;

As a programming language, it defines various variables and parameters, and provides many control structures, including loops and branches, that are available in higher-order languages.

In C ++, shell is the name of the hill sort.

Basically, shell is divided into two categories:

I. graphical user interface shell (GUI shell)

Windows Explorer

X Windows manger (blackbox and fluxbox) and cde, gnome, KD, xfce, etc.

2. command line interface shell (CLI shell)

"Unix/Linux system" bash/SH/KSh/CSH/tcsh

Bourne shell (including SH, KSh, and bash)

Bourne shell (SH)
Korn shell (Ksh)
Bourne again shell (BASH)
POSIX shell (SH)
C shell (including CSH and tcsh)
C shell (CSH)
Tenex/tops C shell (tcsh)
Bourne shell

The default shell in each major operating system:

In Aix, It is the Korn shell.

Solaris and FreeBSD use the Bourne shell by default.
The HP-UX defaults to POSIX shell.
Linux is the Bourne again shell.

MS-DOS system command. com

"Windows NT System" cmd.exe

"Windows NT System Supporting. NET Framework technology" Windows powershell

Shell is also a VB function, which is used to run programs and syntax is shell (command string [, window type])

Linux Shell programming Series

Http://www.ibm.com/developerworks/cn/linux/shell/index.html#firstmajorhead

Shell Introduction
Bash
Awk
Sed
VI, emacs
Shell skills

Shell variable

Differences between histfilesize and histsize

Http://www.linuxeden.com/forum/viewthread.php? Tid = 159573

Two variables are related to the Command's history record.

Histfilesize defines the total number of records for saving commands in. bash_history.
Histsize defines the number of records output by the history command.
Histtimeformat defines the time format for executing commands. The typical configuration is '<% F % T> :'
After the changes take effect, the output of history will be formatted:

1052 <10:13:02>: History

<10:13:02> indicates the time when the history command was executed.

 

/Etc/profile ,~ /. Execution Process of several files such as bash_profile

Http://blog.chinaunix.net/u2/61187/showart_1189840.html
The execution sequence is as follows:

/Etc/profile-> (~ /. Bash_profile | ~ /. Bash_login | ~ /. Profile)-> ~ /. Bashrc->/etc/bashrc-> ~ /. Bash_logout

 

Developers walk UNIX with four unique skills

Http://weiruan85.javaeye.com/blog/333202

Vi + Text Processing + bash shell programming + make or automake

Appendix A: My VI easy to forget command Manual
Up to bottom:
CTRL + U/D up and down half screen, CTRL + F/B, up and down
H/g head/end of screen/Article, 0/$ end of first line

Add, delete, and modify:
YY/DD copy/delete a row, P/P: paste the content of YY/dd
I/A is added at the beginning/end of a row. o/o is used to open a new row. D0/d $ is deleted to the beginning and end of the row.
U: undo

Query:
? Forward lookup, n/n repeat the previous Lookup

Appendix B: Summary of text processing commands
Awk: process structured text (each line is divided into several columns by fixed symbols), extract and print certain fields, such:
Ls-L | awk '{print $1}' -- print the first column of the LS-l result
Awk-F ":" '{print $1 "" $6}'/etc/passwd, print out column 1 and column 6 of the/etc/passwd file, separated by Spaces
For details, see awk instances in ibm dw China (3 in total) or chapter 6th of the Chinese version of the bash beginner's guide.

Grep: filters the most frequently used commands and supports regular expressions. Parameters are: http://www.hudong.com/wiki/grep
-I is case-insensitive.-N indicates the line number,-C indicates the number of occurrences of each file, and-l indicates only the names of the matching files.

Grep (Global Search Regular Expression (re) and print out the line, fully search for the Regular Expression and print the row)

Sed: stream Editor, mainly used for replacement, such:
Sed-e '1, 10 s/Foo/BAR/G' myfile2.txt replace Foo from lines 1 to 10 with bar, s indicates replacement, and G indicates global replacement.
Supports regular expression replacement strings, which can only replace content within a certain range.
The usage is not simple. For details, refer to the SED instance in ibm dw China (3 in total) or chapter 5th of the Chinese version of the bash beginner's guide.

Sort: sorting. The parameters include:
-R reverse order,-N number comparison,-M calendar comparison Feb, Dec,-F case-insensitive
Structured files are also supported, such
Sort-T:-K 1st/etc/passwd, separated by:, sorted by only columns
Sort-T:-K 3.4-k2.2, 1st/etc/passwd, separated by:, first sorted by columns, sort by the second character of the 2nd column to the second character of the 3rd column.

Uniq: removes duplicate rows.
In addition to the normal usage, there are two parameters-C counting repetition times, and-U (unique) and-D (repeated), showing only unique and repeated rows.

WC: statistics.
-L line,-M character,-W word

Appendix C: My automake1.9 step Summary
Write makefile. Am first
Run autoscan to generate Configure. Scan
Modify Configure. Scan and rename the file Configure. In:
Remove the line of ac_config_header ([config. H ])
Add am_init_automake ([1.9 foreign]) (where 1.9 Is the automake version number)
Add ac_prog_libtool (if libtool is used)
Check ac_config_files. If you haven't written all makefile. Am before, autoscan won't help you. You need to manually add it.
Libtoolize (if libtool is used)
Aclocal
Autoconf
Automake -- add-Missing
./Configure
Make

The files to be compiled are converted from makefile to makefile. Am and configure. In. Ace examples is a good reference.

 

 

VI Entry

Https://www6.software.ibm.com/developerworks/cn/education/linux/l-vi/tutorial/index.html

The shell script automatically restarts the stopped/dead Apache httpd process.

Http://community.itbbs.cn/showthread.php? T = 12955

Http://bash.cyberciti.biz/web-server/restart-apache2-httpd-shell-script/

[PPT, PDF] bash shell programming Basics

Http://www.openbsdonly.org/download/file.php? Id = 67

Http://bbs.chinaunix.net/viewthread.php? Tid = 994745

 

Http://wiki.ubuntu.org.cn/shellprogramming Basics

Http://www.linuxsir.org/main/doc/abs/abs3.7cnhtm/index.html

Shell programming basics are from Ubuntu Chinese

Author: Leal

Authorization license:

  • Create sharing agreement
  • GNU Free Documentation License

Edited by: firehare, dbzhang800

Directory

[Hide]

  • 1. Basic Format

    • 1.1 reasonable use of comments
    • 1.2 variable assignment and reference
  • 2 COMMANDS IN SHELL
    • 2.1 Unix Commands
    • 2.2 concept: pipelines, redirection, and backtick
  • 3. Process Control in Shell
    • 3.1 If statement
    • 3.2 & | Operator
  • 4 case statements
    • 4.1 SELECT statement
    • 4.2 While/For Loop
  • 5. Some special symbols in Shell
    • 5.1 quotation marks
    • 5.2 here documents
  • 6. Functions in Shell
  • 7. Command Line Parameters
  • 8 shell script example
    • 8.1 general programming steps
    • 8.2 convert binary to decimal
    • 8.3 circular file copy
  • 9 script debugging

<SCRIPT type = "text/JavaScript"> <! --> </SCRIPT>

[Edit] basic format

We can use any text editor, such as nedit, kedit, emacs, VI, to write shell scripts. It must start with the following line (the first line of the file must be placed ):

# !/bin/sh

...

Symbol #! The program used to tell the system to execute the script. This example uses/bin/sh. After editing and saving, if you want to execute the script, you must first make it executable:

chmod +x filename

Enter./filename in the directory where the script is located to run the script.

[Edit] reasonable use of comments

In the shell script, the line starting with # indicates the comment until the end of the line. We strongly recommend that you make appropriate/reasonable comments in the script, so that even if you haven't used the script for a long time, it can also understand its role and working principles in a short time. Another important reason is that, with the help of comments, others can quickly and effectively share your scripts and provide their own suggestions and improvements.

 

Linux Shell annotator >>## or!

 

From "http://wiki.ubuntu.org.cn/index.php? Title = shell % E7 % BC % 96% E7 % A8 % 8B % E5 % 9f % Ba % E7 % a1 % 80 & variant = ZH-CN" Man

Http://www.lovetech.cn/2007/05/1.html

 

Ubuntu perfect man

1. Add library function manual
Ubuntu does not have the man manual for library functions installed in C language by default. Therefore, when you use functions such as man perror and sendto, no relevant documentation is displayed, this problem has left me depressed for a long time. Solution:
Sudo apt-Get install manpages-Dev

2. Show man Chinese Characters
The Ubuntu source already contains a Chinese man package, so you don't need to go down from other places.
Sudo apt-Get install manpages-ZH
However, man does not display Chinese characters by default. The following two steps are required:
A. Convert the Chinese man package to utf8 format
Create a script file
Gedit T. Sh
Add the following content
#! /Bin/bash

CD/usr/share/man/zh_cn/
For k in *
Do
CD $ K
For I in *. GZ
Do
J = 'echo upload iworkflow .gz }'
Gunzip $ I
Iconv-F gb18030-T utf8 $ j> TMP
Mv tmp $ J
Gzip $ J
Done
CD ..
Done
Then
Sudo./t
B. Modify man's default language
Sudo gedit/etc/manpath. config
Change/usr/share/man to/usr/share/man/zh_cn.
Save and exit. Then try man ls again.

3. Display English without help from Chinese Characters
It is not enough to finish the second part. At this time, you need to man some C language functions (do not use some famous functions such as printf and socket, which have already helped Chinese) the first step has been installed. This is because you changed/usr/share/man to/usr/share/man/zh_cn so that man can only search in Chinese help. If not, give up directly, therefore, the following operations are required to enable man to automatically display help in English when there is no help in Chinese.
Sudo gedit/etc/manpath. config
Then, search for the change you just made and add the same line to the end of the change, but the following directory still uses the original/usr/share/man, for example, the modified
Manpath_map/bin/usr/share/man/zh_cn
Add another row
Manpath_map/bin/usr/share/man

Reference: http://csf.swfc.edu.cn/phpbb/viewtopic.php? P = 6684

More nagging a sentence: man shows the function only boring usage, looks not very good, here we recommend a query C language function of the website http://www.cplusplus.com/, there are each function usage and instance.

Related Article

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.