How to operate a folder with a blank folder name under Linux system

Source: Internet
Author: User

In the Windows operating system, you can easily create \ move \ Delete folders with spaces in the folder name,

In Linux, you need to do some special processing to achieve the above functions.

(1) Create a folder

mkdir my\ First

This command creates the folder "My first" with a space between my and first in the folder name, which you need in the command line

Add a combination of a "\" symbol and a space

mkdir my\ \ Tow

This command creates the folder "My tow" with two spaces between my and tow in the folder name, which is required on the command line

Add a combination of two "\" and a space

(2) Move a folder

MV My\ first/tmp

This command moves the folder "My first" to the folder tmp

MV my\ \ Tow/tmp

This command moves the folder "My tow" to the folder tmp

(3) Delete a folder

Rm-r my\ First

This command removes the folder "My\ first"

Rm-r my\ \ Tow

This command removes the folder "my\ \ Tow"

(4) Enter the folder

CD my\ First

This command can be entered into the folder "my first"

CD my\ \ Tow

This command can be entered into the folder "my Tow"

(5) Create a compressed file

Tar czf my\ first.tar.gz my\ First

Create a compressed file "my first.tar.gz"

Tar czf my\ \ tow.tar.gz my\ \ Tow

Create a compressed file "my tow.tar.gz"

Tar cjf my\ first.tar.bz2 my\ First

Create a compressed file "my first.tar.bz2"

Tar cjf my\ \ tow.tar.bz2 my\ \ Tow

Create a compressed file "my\ \ Tow"

(6) Unzip the compressed file

Tar xzf my\ first.tar.gz

Unzip the compressed file "my first.tar.gz"

Tar xzf my\ \ tow.tar.gz

Unzip the compressed file "my tow.tar.gz"

Tar xjf my\ first.tar.bz2

Unzip the compressed file "my first.tar.bz2"

Tar xjf my\ \ tow.tar.bz2

Unzip the compressed file "my tow.tar.bz2"


Summary: This article implements the folder name in the file with a space to create \ move \ delete \ enter \ compress \ Unzip

, as opposed to folders with spaces in the folder name, you need to enter the command in between the folder name

Insert a combination of "\" with a space, and a few spaces in the folder name need to be added in several combinations.

How to operate a folder with a blank folder name under Linux system

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.