Linux directory Operations

Source: Internet
Author: User
Tags create directory

CD: Changes the current working directory.

PWD: Displays the current working directory name, such as where it is located in the file system.

BaseName: Displays the end portion of the file path.

DirName: Displays the part of the file path that is outside the end.

mkdir: Create directory.

RmDir: Delete Empty directory.

Rm-r: Deletes a non-empty directory and its contents.

CD command

CD [Directory]

The CD (change directory) command is used to set the current working directory:

$ cd/usr/games

When you do not specify a directory, the CD switches to your personal directory by default:

$ cd

PWD command

The PWD command is used to display the absolute path of the current working directory:

$ pwd/users/smith/mydir

basename command

basename path [suffix]

The basename command is used to display the end portion of a file path:

$ basename/users/smith/finances/money.txtmoney.txt

If you provide a file suffix name, the suffix is not displayed:

$ basename/users/smith/finances/money.txt. Txtmoney


Linux directory Operations

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.