Simple commands for Linux

Source: Internet
Author: User

1. Some simple commands
① Open File Command format:
CD [Directory name]
The directory name has a few symbols that have a special meaning, "..." Represents the Previous directory, the "~" represents the home directory, and "-" represents the preceding catalog.
Therefore, you can use the command to return to the previous level directory :
Cd..
② user-switched command format:
su [-FMP] [-C command] [-s Shell] [--help] [--version] [-] [USER [ARG]]
Parameters:

-F, –fast: Do not need to read the boot file (such as CSH.CSHRC, etc.), only for CSH or tcsh two kinds of shell.

-L, –login: After this parameter is added, it is as if it were re-landed, most of the environment variables (such as home, shell, user, etc.) are based on the user, and

and the working directory will also change. If user is not specified, the default is root.

-M,-p, –preserve-environment: does not change the environment variables when performing su.

-C command: Change the user's username and execute the instruction (command) before changing back to the original user.

Help displaying the description file
–version Display version Information

User: To change the user account,
ARG: The new shell parameter is passed in.

  differences between Su [user] and Su-[user] :

su [user] switches to other users, but does not switch environment variables, SU-[user] is the complete switch to the new user environment.

Such as:

[[email protected] ~]# pwd--current directory
/root
[[email protected] ~]# su Oracle--Using SU [user]
[[email protected] root]$ pwd--The current directory does not change, or the previous user directory
/root
[[email protected] root]$ su-oracle--Using Su-[user]
Password:
[[email protected] ~]$ pwd--The current directory becomes the home directory of the current user
/home/oracle
[Email protected] ~]$

So when switching users, try to use Su-[user], otherwise the environment variable may be wrong.

Simple commands for 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.