Linux Learning-relative paths and some commands 20180409

Source: Internet
Author: User
Relative path-the relative path from your current location

Absolute path-The path starting from the root


PWD Current Path

CD change path CD-that's your last location.

Whether you're in the top directory, just enter the command CD and you'll be back when you enter the system.

Cd.. Back to the top level of the catalog


mkdir Create a new directory it creates the last directory of the path, to ensure that it exists before, but you can add options to resolve

Is it possible to create a list of directories?

Mkdir-p can create all the required folders in the path.

The-v option is visual and can see the process


RmDir is the delete empty directory, the-p option can delete a bunch of empty directories can also be removed by the option


The RM command deletes the file, but cannot delete the directory directly, but can be deleted with the-r option, even with the file directory


You can use wildcard characters to match files, file types, filenames, and other specific files

But always prompt, you can use the-f option, do not prompt ask you want to delete, but so do not prompt anything, such as nonexistent directory, it does not prompt, embarrassed.



Environment variable Path

Root windows, the absolute path is added to the environment variable, as long as the command is in the environment variable does not need to hit the full absolute path.

So if you have a new command that you want to add to the environment variable, you can modify the value of the path variable.

This involves the shell, which is good for later operations.

If you want to take effect every time, you need to change the environment variable to permanent, use VIM to change the file.

There is a file can be set to execute the boot, you can change it.

/etc/profile


Linux Learning-relative paths and some commands 20180409

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.