Linux Shell Learning Notes (i)

Source: Internet
Author: User

The shell, known as a program that acts as an interface between the user and the Linux OS, allows the user to enter commands that need to be executed to the OS. There are a lot of shells here, just bash.

  0) Shell version of the experiment

Show Shell version:

/bin/bash--version

Results:

  

1) file. bash_history

This file saves the history command, which is usually saved when the user exits the shell normally, in the directory: "~/.bash_history".

Command Display ~ directory, all files with. Start:

ls grep " .* "

Results:

  

  ①!!, two exclamation mark means "execute last command";

  ②!n, which indicates the execution of the nth command in the history command;

  ③!string, which represents the first command in the execution History command that starts with string;

  2) redirect

  Redirects include: redirected output and redirected output.

  ① REDIRECT Output

   redirect the display to the Test.txt file:

ls -l > Test.txt

Using VIM to open the file, the results are as follows:

    

Append the results of the PS command to the Test.txt file:

PS >> test.txt

Results:

  

  ② REDIRECT Input

Redirect the contents of the Test.txt file to the more command:

 More < Test.txt

Results:

  

Linux Shell Learning Notes (i)

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.