![]() |
Command Line Help: Bulk Moving from Sub-directories to directories
URGENT HELP WITH COMMANDS
I was struggling to find a Linux command to do some pre-processing of data and was wondering if anyone can help me with that. Here is the situation I have: There is a hierarchy of directories and sub-directories as follows: >> I have a Directory with 78 sub-directories. >> Each Sub-directory holds a file (along with many other files) with *.tab extension. >> I want to collect all the *.tab files in one location. >> Later, I want to append all the *.tab files data to one file called MasterTabFile. Any help will be greatly appreciated. Thanks |
Hi & Welcome to Linux Questions.
Before you move all of those files you should consider performing a back up.:) Take a look at this: http://linoxide.com/linux-command/mv-command-linux/ http://linuxcommand.org/lc3_lts0050.php http://www.computerhope.com/unix/umv.htm http://unix.stackexchange.com/questi...r-in-2nd-and-3 http://www.cyberciti.biz/faq/unix-li...ext-to-a-file/ |
I guess I'd make a lousy teacher because I don't know how to direct you toward working this out yourself, but please do study the manpages for find and mv to see why this works:
Code:
cd /path/to/top/directory And yes, I know that directing newcomers to study the find manpage is really dropping them into the deep end of the pool. |
Following on from rknichols, because 'find' is such a useful cmd, there are millions of examples on the net.
As above, backups first, then create some temp dirs/files and play with find until you get it. |
All times are GMT -5. The time now is 05:31 PM. |