Linux Self-Study notes (7): Bash basic features and basic commands

Source: Internet
Author: User
Tags parent directory

Basic features of Bash
(1) Command history
History
Call the last parameter of the previous command
! $
Esc.
atl+.
Control how the command history is recorded
Environment variable: Histcontrol
Ignoreedups: Ignore duplicate commands, continuous and same as "repeat"
Ignorespace: Ignores all commands that start with whitespace
Ignoreboth:ignoreedups,ignorespace

How to modify Environment variables: Export variable named "value"
Variable assignment: The data behind the assignment symbol is stored in the variable name pointing to the memory space;
(2) Command completion
Bash Execution command;
Internal command:
External command: Bash searches for a file of a given command name from the left and right, based on the path defined by the PATH environment variable, which is the command to be executed the first time it is found;
(3) Path completion
Use the user-given string as the beginning of the path and search for the file name at the beginning of the specified string in its established parent directory
(4) Command line expansion
~: Expand to User home directory
~username: Expand the home directory for the specified user
{}: Can host a comma-delimited list and expand it to multiple paths
MKDIR/TMP/X/{Y1,Y2}/{A,B}
mkdir {X,y}{m,n}

(5) Execution result status of the command
Success
Failed
Bash uses a special variable $? Save the execution status result of the most recent command
0 successes
1-255 failure
Program execution has two types of results:
The return value of the program
Execution status results of the program
Directory Management class commands
Cd,pwd,ls,mkdir,tree
Text File View commands
Cat,tac,more,less,tail (view file footer), head (view file header)
Time management tools for files
Touch
Files: Metadata,data
View file status
Three time stamps
Access time, accessed in hours, read the contents of a file
Modify time, modification times, mtime, changing the content of the asking price year
Change time, changing times, ctime, meta data changes

Linux Self-Study notes (7): Bash basic features and basic commands

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.