LINUX_ command format and command prompt

Source: Internet
Author: User
Tags parent directory rsync

# All files in Linux

Command format:

command [feature options] [File path]

cmd [options] [path]

# Multiple feature options to put together, such as

Rsync-avz/backup [email protected]:: Backup--password-file=/etc/rsync.password

In the command window [[email protected] shell]# What does that mean?

# Name: Command line prompt, controlled by environment variable PS1

Root user who is currently logged on to the terminal

Study host name (/etc/sysconfig/network)

~ Current user's home directory

# indicates the root user's terminal

$ normal User's terminal

Command Prompt modification:

# Essence Modify environment variable PS1

1. View the value of the environment variable PS1

echo $PS 1

2. Related parameters

\u Current End user

\h Current host Name

\w which parent directory the current working path belongs to

\w displays the full path of the current working path

\d display date, format: Days of the week and months

\ t 24 format displays time

\ t 12 format displays time

The first few orders issued by \#

\$ user Identity prompt, # indicates the root user, $ represents a normal user

3. Modify the command prompt

Temporary display of the current terminal:

Ps1= ' [\[email protected]\h \ t \w]\$ '

Permanent display:

echo "Export ps1=" [\[email protected]\h \ t \w]\$ ' ">>/etc/profile. /etc/profile

  

LINUX_ command format and command prompt

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.