Steps to delete a folder with a space name in Linux

  
                

When the name of the folder has a space, it can be easily deleted under Windows. However, in Linux system, it is not easy to delete the folder with spaces in the name. The following small series will introduce you to everyone. How to delete a folder with spaces in its name under Linux.

In the Windows operating system can easily create mobile delete folders file names with spaces folder, and in the linux require some special handling in order to achieve the above functions. So what can I do to operate on a file with a folder name with spaces:

(1) Create a folder

mkdir my first

This command creates The folder "my first", there is a space between my and first in the folder name. In the command line, you need

to add a combination of "”" and a space

mkdir my tow

This command creates the folder "my tow", there are two spaces between my and tow in the folder name. In the command line, you need

to add two “”Combination with spaces

(2) Move 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 the file Clip

rm -r my first

This command deletes the folder “my first”

rm -r my tow

This command deletes the folder <;my tow”

(4) into the folder

cd my first

This command can enter the folder“ My first”

cd my tow

This command can go to the folder “my tow”

(5) Create a compressed file

tar czf My first.tar.gz my first

Creating a compressed file “my first.tar.gz”

tar czf my tow.tar.gz my tow

Creating compression File “my tow.tar.gz”

tar cjf my first.tar.bz2 my first

Creating a compressed file“my first.tar.bz2”

Tar cjf my tow.tar.bz2 my tow

Creating a compressed file “my tow”

(6) Extracting the compressed file

tar xzf my first.tar.gz

Unzip compressed files“my first.tar.gz”

tar xzf my tow.tar.gz

Unzip compressed files“my tow.tar.gz”

tar xjf my first.tar.bz2< Br>

Extract the compressed file“my first.tar.bz2”

tar xjf my tow.tar.bz2

Unzip the compressed file“my tow.tar.bz2”< Br>

This article implements the creation of a file with spaces in the folder name to delete and enter the compression and decompression, and other operations, relative to the folder with spaces in the folder name, you need to be in the folder when entering the command Between names, insert “” with a combination of spaces, there are several spaces in the folder name, you need to add a few combinations.

The above is the folder with spaces in the file name deleted under Linux. Although it is easy to delete the folder with the space name in the Linux system without windows, as long as you master the method described above, operate it. It is also very simple.

Copyright © Windows knowledge All Rights Reserved