Linux Fundamentals review-2

Source: Internet
Author: User

Then yesterday's review.

1, bash under the user

Administrator, command prompt for #

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/8D/00/wKiom1iBXxShNd_zAAAN_9YTrKY635.png "title=" 2.PNG " alt= "Wkiom1ibxxshnd_zaaan_9ytrky635.png"/>

For general users, the command prompt is $

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/8C/FD/wKioL1iBXzPSdlMPAAAaBXR0S2U516.png "title=" 3.PNG " alt= "Wkiol1ibxzpsdlmpaaaabxr0s2u516.png"/>

Command prompt format can be set, execute command # echo $PS 1 (note is number 1) View current user command prompt format

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/8C/FD/wKioL1iBX87g6_YHAAAhPykGNqI405.png "title=" 4.PNG " alt= "Wkiol1ibx87g6_yhaaahpykgnqi405.png"/>

The default is [\[email protected]\h \w]\$

The following PS1 means that the command prompt sets the rule to

\d: Display Zhou

\h: Displays the current hostname, and is the name before the first decimal point in the host name

\h: Displays the current full host name

\ t: Display 24-hour format time, HH:MM:SS

\ t: Display 12-hour format time, HH:MM:SS

\a: Display 24-hour format time, hh:mm

\@: Display 12-hour format time, with AM/PM, note @ (not add \) for reserved placeholder

\u: Displays the current user name

\v: Displays information about the bash version

\w: Displays the full working directory name, which starts with the root directory, or the home directory is displayed as ~

\w: Displays the last name of the working directory, or the name of the execution command # basename

\#: Shows the execution of the first few commands, note that this # is inside the parentheses, and the outside meaning is not the same

\$: Prompt, admin #, general user $

As an example,

# ps1= ' [\[email protected]\h \@\v\#]# '

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/8C/FD/wKioL1iBZOuCcan7AAAbJSWWfVU065.png "title=" 5.PNG " alt= "Wkiol1ibzouccan7aaabjswwfvu065.png"/>

Remember to restore back, the default is very good. If you feel that the default does not like, you can modify, want to keep, you can execute

# Vim/etc/profile Modify the global, only the root account can be executed

# vim ~/.bash_profile only modifies the current user's

Add the changes you just made to the last line and save the exit.

2, just mentioned # basename, this operation can display only the base name of the file, that is the name of the file

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/8D/00/wKiom1iBacTTlP9mAAAK5bRYBcQ907.png "title=" 6.PNG " alt= "Wkiom1ibacttlp9maaak5brybcq907.png"/>

At the same time, # dirname show directory Name

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/8D/00/wKiom1iBae-ThYn8AAAKv2Xl8k8927.png "title=" 7.PNG " alt= "Wkiom1ibae-thyn8aaakv2xl8k8927.png"/>

3, the file path of Linux

Absolute path: File path starting from the root directory/

Relative path: A file path that is not started from the root directory

4. linux File System architecture

Hierarchy of

/: Root partition under the root directory, is the entry of the operating system, is the kernel directly refer to the directory, all directories are to be started by the root directory, either under the root partition, or the root partition as the portal to other partitions of the directory, that is, all the files are attached to a directory under the root partition, so as to be accessed!

For example, there is a directory for/data/test.txt,/data/in the root directory, and test.txt This file can be the same as/data/, in the root directory,/data/also mounted to the B directory, test.txt in the B directory (note that at this time/data/ is still in the root directory, and Test.txt is not in the root directory).

5. File system Features

1) The name of the file, which can be any character except/other, length not greater than 255

2) Filenames are strictly case sensitive

6. Get command Help

Bash commands are divided into two main categories

Internal command

External command

# type COMMAND

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/8C/FD/wKioL1iBa0rC3nOpAABuLTho2fw691.png "title=" 8.PNG " alt= "Wkiol1iba0rc3nopaabultho2fw691.png"/>

CD for internal command, basename for external command

There may be other display results, some of the Operation alias, is renamed, this later

Internal commands can

Hlep COMMAND: View the specified named Help information

External command

COMMAND--help

or use

Mans COMMAND

You can use this as long as you have a command.

Linux Fundamentals review-2

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.