?
Solved

Show the content of multiple folder into 1

Posted on 2010-08-28
6
Medium Priority
?
440 Views
Last Modified: 2012-05-10
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
Comment
Question by:4ToNight
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 48

Expert Comment

by:Tintin
ID: 33551753
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
 
LVL 1

Author Comment

by:4ToNight
ID: 33551766
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
 
LVL 1

Author Comment

by:4ToNight
ID: 33554124
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
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
LVL 2

Accepted Solution

by:
maxalarie earned 1500 total points
ID: 34036875
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
 
LVL 2

Expert Comment

by:maxalarie
ID: 34036893
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
 
LVL 1

Author Closing Comment

by:4ToNight
ID: 34450539
thx
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question