![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| perl-like split function for bash? | eur0dad | Shell Programming and Scripting | 5 | 09-05-2008 07:23 PM |
| Passing global variable to a function which is called by another function | sars | Shell Programming and Scripting | 4 | 06-30-2008 12:39 PM |
| awk - split function | fusionX | Shell Programming and Scripting | 7 | 04-10-2008 03:32 AM |
| Split a file with no pattern -- Split, Csplit, Awk | madhunk | UNIX for Dummies Questions & Answers | 10 | 12-17-2007 12:57 PM |
| perl split function | new2ss | Shell Programming and Scripting | 5 | 06-08-2006 11:17 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
split function
Hi all!
I am relatively new to UNIX staff, and I have come across a problem: I have a big directory, which contains 100 smaller ones. Each of the 100 contains a file ending in .txt , so there are 100 files ending in .txt I want to split each of the 100 files in smaller ones, which will contain 2000 lines each. I think that 'split' command is what I must use, but I don't know how. I go something like: find . -name "*.txt" | ..... Any hints on the missing part? How can I apply the split command in each file, without entering each directory? Thanx |
|
||||
|
Hi, thanx very much for your time.
Excuse my foolish question, but what are {} \ in your code? find . -name '*.txt' -exec split -l 10 {} \; I understand 'find - name '*.txt' ', I suppose -exec is for the system to execute a command, -l 10 I have found it in man split that are the arguments passed for split, but {} and \ I don't understand. I tried your code, but it didn't work ![]() I am sure that I am lacking something here, if you could just point it out... |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|