Shell script Management in Linux (i)

Source: Internet
Author: User
Tags aliases linux

One: The role of Shell and common types:

The shell is a special application that is between the operating system kernel and the user, responsible for accepting the user-entered operation instructions (commands) and interpreting them, passing the required actions to the kernel for execution. Therefore, the shell program acts as a "command interpreter" in the system, eg: Microsoft's Cmd.exe also belongs to the shell program;

In the Unix/linux operating system, there are many kinds of shell programs that can be used, the function is also more powerful than Microsoft's "cmd.exe", the following is often seen Shell program environment, (function can own to understand under:)

Bsh:

Csh:

Ksh:

Bash:

Zsh:

1, the shell environment switch:

In order to improve the compatibility of the system, the RHEL5 system is provided with the support of various common shell programs, through the configuration file "/etc/shells" can understand the path of the shell program supported by the system;

View a list of shell programs that you can use in your current Linux system:

Some of these shell programs are actually symbolic link files for other shell programs, in order to better provide compatibility between shell programs, EG:TCSH is a compatible upgraded version of CSH, so the TCSH will run directly when the system runs CSH.

Confirm some of the linked files that exist in the shell program:

Users in the implementation of the Linux command operation, if you want to use other shell program environment, you can make the appropriate switch.

Ksh can switch to KSH program Environment//////echo $

Exit can be returned

1.2: Change the user's own login shell

Every time a user logs on to the Linux system, the system automatically loads the shell program that is the user's login shell, the user's login shell information is recorded in the "/etc/passwd" file, and allows the user to modify it through the CHSH command.

After a new login shell is set with the Chsh command, the new login shell takes effect the next time the user logs on to the system

1.3: Change the login shell of another user by admin (Root)

Usermod-s/bin/bash teacher can!

2, Bash's common functions: (Tab key automatically filled ...) )

2.1: Order History: History

2.2: Command alias: Alias

To view all command aliases that have been set:

Eg: set a command alias dir to perform the "Ls-ld--color=tty" command and confirm it.

Cancels the dir command alias that was set in the previous step:

Unalias dir can///////////alias-a cancel all the command aliases

This column more highlights: http://www.bianceng.cn/OS/Linux/

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.