Linux command line and shell scripting---bash shell commands

Source: Internet
Author: User
Tags parent directory

PS1 = "[\t][\u]\$"//New shell prompt shows the current time and user name

In Windows, you often see such file paths: D:\work\FTL Moniqi\ftl_lru-0513\ftl_lru-0513\si

Linux takes a different approach. Linux stores files in a single directory structure, a directory that we call virtual directories. The virtual directory contains the file paths for all storage devices installed on the PC.

Linux uses the forward slash "/" instead of the backslash "\" to plan the directory in the file path.

Relative path: There are two special characters

1. A single dot (.), which indicates the current directory;

2. Double dot character (.. ) that represents the parent directory of the current directory

The two-point Mr. Foo takes the user to the top-level directory and, if necessary, the user can switch the directory up by multiple double points.

Standard wildcard characters:

1. The question mark represents a character.

2. An asterisk represents 0 or more characters.

There are two different kinds of file links in Linux:

1. Symbolic links, i.e. soft links;

2. Hard Links

A hard link creates a stand-alone file that contains the information and location of the source file. Referencing a hard-link file is equivalent to referencing a source file

Cp-l test1 test4

The-l parameter creates a hard-link test4 that points to the file test1.

Note: You can only create hard links between files on the same storage media, and you cannot create hard links between files under different mount points.

The parameter-s creates a symbolic link, or a soft connection

Cp-s Test TEST5

When copying a linked file, be aware that if you use the CP command to copy a file that is linked to another source file. The copy is actually another copy of the source file. Instead of a linked file.

Stat command: You can provide all state information for a file on a file system.

File command: One to view files of type

Linux command line and shell scripting---bash shell commands

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.