Shell Basics 1

Source: Internet
Author: User

Shell Introduction

Shell is a Linux interactive media with users the CentOS default shell is bash
Command History 2

User home directory file record command history
Ls/root/.bash_history
History view commands Historical maximum can view 1000 article

environment variable Settings 1000

History-c empty the commands in memory
Empty command
The command will be written to the file only when you exit the terminal

Sets the number of command history/etc/profile

Modify the command history value

Make the variable effective source/etc/profile

Add a command to use time to set the variable format


Make the variable effective modify the configuration file/etc/profile

Source/etc/profile
Permanently save command file add a permission

!! Executes the previous command
! n Number of commands to execute

! Character performs the most recent command that begins with a character

Features of the command

The TAB key lists all commands that begin with a character by pressing the two

The TAB key automatically complements the command parameters

I need that completion bag.

Effective requires restart
Aliases Alias

Define the profile for the alias
defined in scripts under. BASHRC and PROFILE.D


Cancel Alias Unalias

Wildcard characters , output orientation

Pass Match
Files ending in *.txt

No characters and several

Ls?. Txt? Represents an arbitrary character

LS [0-3].txt the characters inside the square brackets take only one
Scope of support

ls {1,2,3}.txt curly brace

Output Punch
Cat 1.txt>2.txt Remove the original content rewrite
Cat 1.txt>>2.txt will not delete the original content will append to the file after
2> Error Redirection
2>> Error Append redirect

&> Hybrid Redirection

Support for Append content

Categorical redirection separate error messages and correct information

Less than sign <
Enter the file on the right to a command.

Shell Fundamentals 1

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.