Linked Questions

1
vote
1answer
1k views

Move directory structure and preserve symlinks [duplicate]

I'm trying to work around a makefile issue where libraries are installed in the wrong place. Someone else wrote the makefile and it is not easy to fix. I'm trying to move the libraries after they have ...
202
votes
7answers
523k views

How to move and overwrite subdirectories (and files) to parent directory?

I have a ton of files and dirs in a subdirectory I want to move to the parent directory. There are already some files and dirs in the target directory which need to be overwritten. Files that are only ...
170
votes
6answers
201k views

How to copy-merge two directories?

I have two directories images and images2 with this structure in Linux: /images/ad /images/fe /images/foo ... and other 4000 folders and the other is like: /images2/ad /images2/fe /...
25
votes
2answers
30k views

Hard-link creation - Permissions?

Which permissions affect hard-link creation? Does file ownership itself matters? Suppose user alice wants to create a hard-link to the file target.txt in a directory target-dir. Which permissions ...
9
votes
1answer
5k views

Hard link permissions behavior different between CentOS 6 and CentOS 7

I'm getting a permissions error in CentOS 7 when I try to create a hard link. With the same permissions set in CentOS 6 I do not get the error. The issue centers on group permissions. I'm not sure ...
1
vote
2answers
3k views

How should I merge two folders on the same filesystem?

I have two directories that look something like the following but with many more files. folder1/pic1.png folder1/test/readme.txt folder2/guest.html folder2/backup/notes.txt I want to "merge" these ...
2
votes
1answer
1k views

How can I create an union merging / and another directory, on / itself?

Say, we initially have / with the following contents: /bin/foo /usr/bin/bar /usr/lib/libfoo.so We also have another directory, say /stuff, with the contents: usr/lib/mystuff/mystuff.so etc/foo/qux/...
2
votes
1answer
161 views

Merely moving a directory inside another using mv

I just came across this weirdness: I want to do the equivalent of dragging a directory inside another (moving it). Trival day-to-day task for a GUI. here is my tree: . ├── assemble.py ├── Basic ...
1
vote
1answer
358 views

Copying/Moving folders where destination folder already exists

I am writing a bash script to copy/move a folder called "folder" to a directory that already contains "folder" and I would like the contents to be merged. I am attempting to use a solution from this ...
0
votes
0answers
59 views

How do I --move— the contents of 1 folder (with subfolders) to another folder (with the same subfolder names as the source)?

I think this is best explained with an example. Example: /mnt/mystorage/source => folder1 => file11.txt => folder2 => file21.txt /mnt/mystorage/destination =&...
1
vote
0answers
40 views

using rsync to move merge files into new directory fails to show progress or create backups

I have a bunch of old backups, each of which is a directory containing incremental changes from the previous backup. There are arbitrarily nested directories and files in each directory. I need to ...