Find - Excluding multiple Directories w/o showing files within
Object: Create backup file of chosen directory with 'tar'.
I am trying to write a bash script using 'find' to produce an input file to 'tar'. The line that creates the input file is below. find . -type d \( -name JAVASCRIPT -o -name 'jqueryinaction*' \) -prune -o -print | sort > /home/rick/Desktop/tar-include-file This does exclude the directories I don't want in the current directory and creates the file but it includes all the individual file names also. I've also tried to use -path in the above with the same results. The line below creates the correct format but, of course, includes the directories that I don't want. find . -type d | sort > /home/rick/Desktop/b1-include-file Thanks in advance for any help you can give me. R |
You're passing no selection criteria to -print: everything that isn't pruned gets printed.
You want `-type d` before the -print. |
SOLVED: :cool: Thanks jthill that fixed it!
|
All times are GMT -5. The time now is 10:03 AM. |