There will always be more and more Unix systems, and developers do not have to learn about their installation, configuration, and management. They should all be handed over to the Integration personnel.
However, developers still have four skills to walk between UNIX.
I. vi
Although the text editor on Unix has become more and more useful, but it is not in front of the console, when the network speed is not enough to connect to xwindows, it is still dependent on VI.
Looking back at the background of the VI era, we found that VI has been very considerate to developers, and the hot key is so much as you can complete most of the editing work without leaving your hands on the keyboard.
We recommend that you create a sheet command that you think is useful but often forgets, and take the test effort to familiarize yourself with it.
Ii. Text Processing
Except make and bug, which are the most common tasks for developers in UNIX, are to handle log files and business files for error checking and statistics.
It is not enough to only use more and grep. Developers will assemble the text processing commands such as awk, sed, grep, sort, unique, and WC through the Disassembly and assembly of pipeline toys, finally, I completed a job that was originally intended not to write a large segment of code. Thoughtful parameter settings make people once again lament the complicated and extreme design of that simple age ...... No wonder the authors of Unix programming art are so proud and conscious.
For example, chelong's top 10 Statistics scripts for monthly access:
Awk-F 't'' {print $4} '2004_2.txt | grep chedong.com/tech/ | sort | uniq-c | sort-Rn | head-10
- Awk-F'/t' splits the 2004_2.txt access record file by tab and prints 4th columns
- Grep chedong.com/tech only lists the documents in the chedong.com/techtutorial directory;
- Sort sorting
- Uniq-C Summary count
- Sort-Rn by Numerical Value
- Head-10 top 10
Iii. bash shell programming
Programming is a natural skill for developers. You should be able to get started by looking at the reference manual in whatever language. See
Chinese version of bash beginner's Guide
Iv. Make and automake
After using ant in Java, I feel bored and bored when I think of make. It always works. See
GNU make 3.8.0 Chinese manual
However, even if make is already proficient in metamorphosis, The makefile written by everyone is still strange. Let's take a look at the open-source projects where all are automake + Autoconf. Let's make a little better on our own.
You must first compile makefile. Am and auotomake and then convert it into makefile. in. The user./configure can then generate the final makefile.
Makefile. the makefile generated by AM can be written across platforms and standards. The most important thing is to write makefile. the workload of AM is much less than that of makefile. As long as the target file is defined in a simple way, sub-directories to be processed, the required source files, the des file and the library file can be processed first.
In addition, ACE also contributes a more powerful makefile (makefile, project, and workspace creator) to automatically generate makefile. Am or VC project files.
Getting Started: Use automake to easily generate makefile
Advanced: Use Autoconf and automake to generate makefile
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, 0/$ End of the 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) and 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
See the IBM Tutorial: http://www-128.ibm.com/developerworks/cn/linux/shell/awk/awk-1/index.html (3 in total)
Grep:Filter: the most frequently used commands. Regular Expressions are supported. Parameters include:
-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.
Sed:Replacement, for example:
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.
Usage is not simple, see IBM http://www.ibm.com/developerworks/cn/linux/shell/sed/sed-1/index.html (three chapters in total)
Sort:Sort by parameters:
-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:Remove duplicate rows.
In addition to normal usage, the-U (unique) and-D (repeated) parameters only display unique and repeated rows.
WC:Statistics.
-L line,-M character,-W word
PS: the following words are not counted as words
I haven't updated my blog for more than a month, because I have transferred a new department in my company and I have to learn a lot. I have never tried to go to work for too long. I am very happy to learn so much from my colleagues at work.
Updates will begin next week.