Notes on Linux private food for laruence (9) -- bash1

Source: Internet
Author: User
I. Shell introduction Shell: the command line interpreter is a medium for users to communicate with the system. There are various shells in the Unix system, linux uses bash to record the shell records that can be used by its default shell system in etcshells 2. bashbash: BourneAgainShell

I. INTRODUCTION to Shell

Shell: The command line interpreter. it is a media used to communicate with the system.

There are various shells in Unix systems. Linux uses bash as its default Shell.

The shell records that can be used by the system are stored in/etc/shells.

II. bash

Bash: Abbreviation of Bourne Again Shell

A component of the GNU program

It is fully compatible with the Bourne Shell on Unix.

Supports command line input, operation history query, shortcut keys, usage variables, and other functions.



III. predefined environment variables

There are many predefined environment variables in bash (pre-defined names and used variables)

The system defines the shell environment through predefined environment variables. VcD4KPHA + 08O7p7/logs/PC9wPgo8cD5zZXS/ydLUsum/tLu3vrOx5MG/o6jL + fingerprint + 0u7e + Fingerprint = "http://www.2cto.com/uploadfile/Collfiles/20140108/201401081302363.jpg" alt = "\">

Common predefined environment variables

HOME: HOME directory of the current user

PATH: The executable file search PATH of the current user.


LANG: the default language that the program should use.


PS1: line prompt


IV. history

Input the histroy command in bash to query users' previous operations.

The number of past commands recorded in the memory depends on the HISTSIZE in the environment variable.


The history table is stored in the memory. when you log out, it is recorded in the. bash_history file in the user's main directory. Load the login at the next time.

The number of commands in. bash_history depends on the HISTFILESIZE in the environment variable.


Force write:


5. call past commands

Use! To call past commands

!! : Execute the previous command repeatedly.

! A: repeat the previous a-led command.

! Number: Repeat the previous command to record the number as number in the history table.

! -Number: number of the First Command before repeated execution

! $: Truncate the last value of the previous command.

Available To query past commands in the history table

6. alias

Enter alias in shell to query the current alias list

You can use alias to obtain a simple alias for a command.

You can also use unalias to cancel an alias record.

Alias record always goes first in shell




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.