把兩個資夾裡,如何取出相同的檔案 - Linux

By Kelly
at 2014-07-09T10:25
at 2014-07-09T10:25
Table of Contents
我有A跟B兩個資料夾
裡面有很多檔案,還有子目錄
我想要把A跟B裡相同的檔案都取出來放在一個叫common的資料夾裡
請問該怎麼做?
由於這兩個資料夾是embedded system的rootfs
裡面有busybox建立的soft link
我有試著用find -type l先把soft link找出來,然後手動比較之後找出common的部分
結果我用
for i in `cat common.txt`
do
cp a/$i common -a
done
他把全部的檔案都copy進同一個資料夾,沒有照子目錄分類...
這有什麼辦法嗎?
--
裡面有很多檔案,還有子目錄
我想要把A跟B裡相同的檔案都取出來放在一個叫common的資料夾裡
請問該怎麼做?
由於這兩個資料夾是embedded system的rootfs
裡面有busybox建立的soft link
我有試著用find -type l先把soft link找出來,然後手動比較之後找出common的部分
結果我用
for i in `cat common.txt`
do
cp a/$i common -a
done
他把全部的檔案都copy進同一個資料夾,沒有照子目錄分類...
這有什麼辦法嗎?
--
Tags:
Linux
All Comments

By Dora
at 2014-07-13T12:48
at 2014-07-13T12:48
Related Posts
請問一個我從沒看過的狀況問題..

By Anonymous
at 2014-07-09T00:17
at 2014-07-09T00:17
SSD+HDD 混碟灌ubuntu/win8雙系統

By Tristan Cohan
at 2014-07-08T12:07
at 2014-07-08T12:07
compiler錯誤 linker input file unused

By Una
at 2014-07-08T11:58
at 2014-07-08T11:58
SSD+HDD 混碟灌ubuntu/win8雙系統

By Puput
at 2014-07-08T11:42
at 2014-07-08T11:42
SSD+HDD 混碟灌ubuntu/win8雙系統

By Susan
at 2014-07-08T09:50
at 2014-07-08T09:50