简体   繁体   中英

Move a file to a directory that is within another directory and rename it in one command line?

So, we have a parent_dir and it contains a child_dir and a file1. How can I move a file1 to a child_dir and rename it as file2? let's assume my pwd is /var

You can just move a file from one dest. to another (it changes its name):

mv /parent_dir/file1 /parent_dir/child_dir/file2 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM