How to operate a folder with spaces in linux
Today, I will talk to you about how to manipulate folders with spaces in linux. Many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can gain something according to this article.
(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 is required on 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 spaces
(2) move folders
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 folder
Rm-r my first
This command deletes the folder "my first"
Rm-r my tow
This command deletes the folder "my tow"
(4) enter the folder
Cd my first
This command can go to 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
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) decompress the compressed file
Tar xzf my first.tar.gz
Extract the compressed file "my first.tar.gz"
Tar xzf my tow.tar.gz
Extract the compressed file "my tow.tar.gz"
Tar xjf my first.tar.bz2
Extract the compressed file "my first.tar.bz2"
Tar xjf my tow.tar.bz2
Extract the compressed file "my tow.tar.bz2"
After reading the above, do you have any further understanding of how to manipulate folders with spaces in linux? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.