Quick Tips for several CDs

Source: Internet
Author: User

A CD is a command that the project master uses every day.

Share a few tips on CD today.

Cd

If you use CD ~ To enter the current user's home folder, then you can try to hit the CD directly.

The same effect, less knocking two keyboards.

CD-

CD-Used for switching between two working folders in the near future. For example, it is now below/usr and then Cd/var. If you want to return to/usr below, you can use CD-.

CD ~username

This command can be accessed directly into the Username home folder.

Cd+ls

According to my observation. A lot of the next command the project teacher has after he finishes the CD is LS. So. The ability to consider combining two commands.

In the. bashrc file, add the following code after you enter the folder to list the files in the folder:

function CD () {Builtin cd ${1:-$HOME} && ls;}
Mkdir+cd

After you create a new folder, you will typically get to that folder. As a result, two commands can be combined together. In the. bashrc file. Add the following code to create a new folder and enter the folder later with the command MKDIRCD.

function Mkdircd () {mkdir-p "[email protected]" && eval cd "\" $$#\ "";}

In some distributions of Linux, use the. will be able to access the parent folder.

If you use a version number that does not have this function, add the following code to the. BASHRC, for example.

Alias.. = "CD.."

You can also define ... to enter the two-tier folder.

If you want to know the latest tricks, please follow the public number "project Division"


Copyright notice: This article blog original article. Blogs, without consent, may not be reproduced.

Quick Tips for several CDs

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.