?
Solved

Renaming forlders

Posted on 2003-03-07
2
Medium Priority
?
220 Views
Last Modified: 2010-04-20
This seems like a very simple thing... I'm pretty new to linux, so I just don't know how to do it.

I want to rename folders.
The name of the folder might already exist, in which case it needs to replace the contents of that folder... but if that's a problem i can delete the folder prior to renaming the new one.

basically...

Backup6 --> Backup7
Backup5 --> Backup6
.
.
.
Backup1 --> Backup2
My Dir --> Backup1  (this one is a copy, not a rename)

Thanks
0
Comment
Question by:s_mack
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
arn0ld earned 80 total points
ID: 8090749
man mv
info mv

rm -rf Backup7 2>/dev/null
mv Backup6 Backup7
etc.
0
 

Author Comment

by:s_mack
ID: 8091141
Thanks!  I knew it was something basic. I didn't think that mv would be the command, so thanks for pointing that out.

But why does this work???

When 6 --> 7, if 7 exists why doesn't it ADD the files to the folder??  I mean.. it works, and I'm happy. But what if I didn't want to COMPLETELY replace 7 with 6 but rather add 6's files to 7???

Just curious.
0

Featured Post

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month8 days, 17 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question