Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #243943 > unrolled thread

restructure folders

Started by"sp007@caiway.net" <sp007@caiway.net>
First post2022-01-13 05:50 +0100
Last post2022-01-13 07:10 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.debian.user


Contents

  restructure folders "sp007@caiway.net" <sp007@caiway.net> - 2022-01-13 05:50 +0100
    Re: restructure folders Keith Bainbridge <keithrbaugroups@gmail.com> - 2022-01-13 06:00 +0100
    Re: restructure folders Charles Curley <charlescurley@charlescurley.com> - 2022-01-13 07:10 +0100

#243943 — restructure folders

From"sp007@caiway.net" <sp007@caiway.net>
Date2022-01-13 05:50 +0100
Subjectrestructure folders
Message-ID<DF0dH-2tc-3@gated-at.bofh.it>
I have this foldertree tree:

/dir1/dirA/dirB
/dir2/dir*

I want the foldertree to become:

/dirA/DirB
/dir*


Is this possible on the commandline?
Any idea is welcome

Thanks!

[toc] | [next] | [standalone]


#243944

FromKeith Bainbridge <keithrbaugroups@gmail.com>
Date2022-01-13 06:00 +0100
Message-ID<DF0nn-2xp-1@gated-at.bofh.it>
In reply to#243943
On 13/1/22 15:31, sp007@caiway.net wrote:
> I have this foldertree tree:
> 
> /dir1/dirA/dirB
> /dir2/dir*
> 
> I want the foldertree to become:
> 
> /dirA/DirB
> /dir*
> 
> 
> Is this possible on the commandline?
> Any idea is welcome
> 
> Thanks!
> 
> 
> 
> 
> 


Question - why do you have these directories in /

If they really are in /   would this do what you want

cd /dir1
mv dirA  /

cd /dir2
mv dir*  /

I'd suggest you would be safer doing this in mc (a cli file manager) so 
you can see where you are sending the files


-- 
All the best

Keith Bainbridge

keithrbaugroups@gmail.com

[toc] | [prev] | [next] | [standalone]


#243949

FromCharles Curley <charlescurley@charlescurley.com>
Date2022-01-13 07:10 +0100
Message-ID<DF1t8-3CK-1@gated-at.bofh.it>
In reply to#243943
On Thu, 13 Jan 2022 05:31:25 +0100
"sp007@caiway.net" <sp007@caiway.net> wrote:

> Is this possible on the commandline?

Yes. The following untested code should do it:

cd /
mv dir1/dirA .
mv dir2/dir* .
rm -r dir1 dir2

In particular, you will lose any files in dir1 and dir2 not specified
in the relevant mv. Also, the wild card specification in line 3 will
grab files as well as directories.

I suggest you make backups first if you don't make them regularly
(which you should).



-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web