• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 441
  • Last Modified:

Show the content of multiple folder into 1

Hi,

I would like to know how can I show the content of multiple folders into one folder on linux.

For an Exemple :

I have the dir "/home/username/folder1" with 2 files in it "file1 and file2"
and I have the dir "/home/username/folder2" with 4 files in it "file10,file11,file12,file13"

what I want is to show "file1" and "file2" into "folder2", I don't want to show the directory "folder1" with ln -s.

Thanks.
0
4ToNight
Asked:
4ToNight
  • 3
  • 2
1 Solution
 
TintinCommented:
Assuming the two folders are on the same filesystem, you could use a hard link, ie:

ln /home/username/folder1/file* /home/username/folder2
0
 
4ToNightAuthor Commented:
oups yeah good solution but I forgot to say, files are not statics.  More files is added every days.

I know I could use this solution with a cron job but I would like something more "Clean".

Thanks!
0
 
4ToNightAuthor Commented:
i'm asking this because I have 2 raidz pool, so two samba share, and I would like to show all the files in one so I can delete the other share.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
maxalarieCommented:
rsync  Folder_1 Folder_2  # This will sync  folder 1 in Folder 2, it will add all Folder_1 files into Folder_2

Unshare Folder_1.

0
 
maxalarieCommented:
You can also run rsync as a cronjob every night... or every hour.. or even every minute of everyday.

Here is the  Cron syntax:



#Crontab Reference
#       *     *     *   *    *        command to be executed
#       -     -     -   -    -
#       |     |     |   |    |
#       |     |     |   |    +----- day of week (0 - 6) (Sunday=0)
#       |     |     |   +------- month (1 - 12)
#       |     |     +--------- day of        month (1 - 31)
#       |     +----------- hour (0 - 23)
#       +------------- min (0 - 59)

Open in new window

0
 
4ToNightAuthor Commented:
thx
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now