apt install unionfs-fuse tree
- Create Three Folders named
Folder-1
, Folder-2
and mnt
mkdir Folder-1 Folder-2 mnt

- Create sub-directories and files in
Folder-1
and Folder-2
mkdir -p Folder-1/Dir1 Folder-2/Dir1 Folder-2/Dir2
touch Folder-1/File1.txt Folder-1/Dir1/dir1.txt Folder-1/Dir1/one.txt
touch Folder-2/Dir1/file2.txt Folder-2/Dir1/two.txt Folder-2/Dir2/dir2_file.txt Folder-2/File2.txt

- Check the structure of directories that have been created

- Run
unionfs-fuse -o dirs=Folder-1:Folder-2 mnt/
. The directories and files in Folder-1
and Folder-2
will be mounted on mnt
unionfs-fuse -o dirs=Folder-1:Folder-2 mnt/

- Check the structure of
mnt/

- To unmount, run
umount -l mnt

- Remove the directories sub-directories and files created
rm -rf Folder-1 Folder-2 mnt