Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of moving files to a specified directory under linux

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

How to move files to a specified directory under linux? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!

The method of moving files to a specified directory under linux: you can use the mv command to move, such as [mv *.. /], which means to move all files under the current folder to a higher directory. The mv command is used to rename or move a file or directory.

The role of the mv command

Mv command to rename a file or directory or move a file from one directory to another. This command is equivalent to the combination of ren and move commands on DOS systems. Its permission is for all users.

Format

Mv [options] Source file or directory destination file or directory

Main parameters

-I: operate interactively. If the mv operation will result in an overwrite of an existing target file, the system asks whether to rewrite and asks the user to answer "y" or "n" to avoid mistakenly overwriting the file.

-f: interoperability is prohibited. The mv operation does not give any indication when it wants to overwrite an existing target file, and the I parameter will no longer work when this parameter is specified.

For example:

(1) move all files in / usr/udt to the current directory (with "." Represents):

$mv / usr/udt/*.

(2) rename the file test.txt to wbk.txt:

$mv test.txt wbk.txt

(3) move files from one subdirectory of the current directory to another subdirectory

Mv file name / * another directory

(4) move all files under the current folder to a higher level directory

Mv *.. / Thank you for your reading! After reading the above, do you have a general understanding of the method of moving files to a specified directory under linux? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report