?
Solved

Show the content of multiple folder into 1

Posted on 2010-08-28
6
Medium Priority
?
439 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

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

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month13 days, 6 hours left to enroll

800 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