Linux Learning Note 2016.03.13

Source: Internet
Author: User

Whining, today 10:30 back from the lab and the girlfriend quarreled very big, are about to break up the feeling, but learning can not be interrupted, because only no matter what all adhere to the good habits, I know that if I and my girlfriend in the future to live together, I also must have more skills to earn money to support her!

But very annoying ah, do not see, ah, today saw two commands, about the file operation, summed it down.

1. Create a File command touch create a plain file with no attributes, just add the file name directly behind the touch, as touch A has built an empty file a

2, the creation of a content file, generally also can be created by creating a new file, and then through the Vim editor to edit the content, create a file initially to add some content to the file can use the command echo, about this command some other things need to mention, first, the shell Defines the standard input and standard output of the initial system, as well as standard error handling, the standard input is the read command from the keyboard, the standard output is to print the command execution results to the screen, the standard error is that if the input command error, the error will be printed to the screen, while the shell allows input and output redirection, That is, you can change the direction of the standard output, from the screen to other files, using the symbol > or >> can achieve the output from the orientation, where,> is the character obtained from the keyboard into the specified new file,>> means to input the content to the end of the existing file, If the file exists directly to manipulate the file, if the file does not exist to create the file and then perform the input operation, but note that the character can not be entered directly and then followed by the > symbol, such as ABC > A was originally intended to input ABC into file A, but need to understand a concept, The shell can only accept commands, input and output characters must also use the input function of the command line, such as we want to print on the screen AAA so direct input AAA is not achieve the purpose, but will be the error message prompt did not find the command, we want to print the words need to use the command echo,     The original function of this command is to print some content to the screen, the content is displayed behind the echo, such as echo AA BB cc DD will be printed on the screen AA BB cc DD, a number of spaces will be replaced by a space, another use is echo "AA BB CCC DDD "So the screen will print out the AA BB CCC DDD will be output as is, this is the standard output command below the shell, then we can combine the redirect command to achieve a specific file output character, such as Cat Aaa>a

The meaning is to enter a character AAA, this command if the target file does not exist, it will create a new file and enter the operation, if the source file already exists then use > input will overwrite the contents of the original file, and the >> command will continue to write after the original file.

In addition, the piggyback learns to view the file command Cat AA. You can view the contents of a file. Today will be here, change to sleep, tomorrow will have to adjust the board, so tired AH this paragraph

Linux Learning Note 2016.03.13

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.