Shell Programming Learning 2--Command Daquan

Source: Internet
Author: User

There are a number of commands in Linux that can be divided into 10 categories (see [1]): 1) file management; 2) document editing; 3) file transfer; 4) Disk Management; 5) disk maintenance; 6) network communication; 7) system management; 8) system setup; 9) Backup compression; 10) Device Management.

Linux:command1 | Command2

"|" In fact, Linux inside a pipe symbol , the two commands are separated, Command1 output as the input of Command2; You can also use multiple pipelines consecutively , representing the output of the Command1 as the input of the Command2, the output of Command2 as the input of the Command3, and so on.

grep (Global Regular Expression Print)

The grep command belongs to the "Class II-Document editing class", a powerful text-search tool that can use regular expressions to search for text and print matching lines.

> and >> : $ echo "Demo" >de.c (write "demo" to the de.c file, you must bring echo, ECHO is the result to the output file)

If the file does not exist, a new file is created and the data is written to the file; If the file exists, then the file is emptied and the data is written to the file;

>>: If the file does not exist, a new file is created and the data is written to this file; If the file exists, then writes the data to the back of the contents of the file;

BaseName vs DirName

BaseName: base name, file name; DirName: directory name, Path; It can be distinguished by the meaning of the two.

basename /etc/bin/sortsortdirname /etc/bin/sort/etc/  basename/dirname /etc/  

[1] Linux command Daquan: http://www.runoob.com/linux/linux-command-manual.html

[2] Learning linux,101 (IBM's tutorial, very good): https://www.ibm.com/developerworks/cn/views/linux/libraryview.jsp?search_by=%E5%AD% A6%e4%b9%a0+linux%ef%bc%8c101

[3] Linux Shell Scripting turotial:http://www.freeos.com/guides/lsst/index.html

Shell Programming Learning 2--Command Daquan

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.