I was wondering about following
Let's say you have two directory's in linux dir1 and dir2. now when I do
mv dir1 dir2
then dir1 gets moved into dir2.
But what if I want to rename dir1 into dir2? And while dir2 already exist, let bash tell me so and ask me if I wish to override? or maybe just tell me that it can't be renamed for it already exists?
Is there a way for this?
If you use
mv
with optioni
it will prompt and check do you prefer to overwrite an existing directory or not if it is existing.If
dir1
anddir2
exists and you try as follows it will prompt you. If dir2 is not existing it will not prompt.