Sponsored Content
Full Discussion: Exclude certain folders
Top Forums Shell Programming and Scripting Exclude certain folders Post 302912061 by rbatte1 on Tuesday 5th of August 2014 01:02:33 PM
Old 08-05-2014
Welcome arumugavelvelu ,

Firstly, you don't need -name '*' which says "only objects called anything" so leaving it out will ignore name matching and find objects that match the other criteria giving you the same result.

If you have a fixed set of input directories, then you could set your variables at the top to refer to them, e.g.:-
Code:
SRC_CDR_OUTBOUND="/omount/outbound/DIR1 /omount/outbound/DIR3 /omount/outbound/DIR4"
SRC_CDR_INBOUND="/omount/inbound/DIR1 /omount/inbound/DIR3 /omount/inbound/DIR4"

These will then get used by your find command as the directories to search.

If the directories may change over time and you don't want to recode them, you may need to do something a bit more elaborate like:
Code:
SRC_CDR_OUTBOUND="`ls -1d /omount/outbound/* | grep -v DIR2"
SRC_CDR_INBOUND="`ls -1d /omount/inbound/* | grep -v DIR2"


This will get you all the objects at that level, so if you want to exclude files, then you have to be more elaborate still:-
Code:
SRC_CDR_OUTBOUND="`find /omount/outbound -type d ! -name DIR2 | cut -f-4 -d\"\/\" |sort -u`"
SRC_CDR_INBOUND="`find /omount/inbound -type d ! -name DIR2 | cut -f-4 -d\"\/\" |sort -u`"


Do these achieve what you need, or have I missed the point somewhere?



Robin

Last edited by rbatte1; 08-05-2014 at 02:03 PM.. Reason: Line spacing to make it easier to read
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Backing up Folders without some folders...;)

I am in a fix....... I have to write a backup script to backup say Folder A. Folder A contains n folders 1,2 ,3 .....n. my script should copy A without folder 2 & 3. Is there anyway I can do it without writing individual copy commands???? Please help.... (1 Reply)
Discussion started by: chimpu
1 Replies

2. UNIX for Dummies Questions & Answers

Copying Folders without some folders... ;-)

I am in a fix....... I have to write a backup script to backup say Folder A. Folder A contains n folders 1,2 ,3 .....n. my script should copy A without folder 2 & 3. Is there anyway I can do it without writing individual copy commands???? Please help.... (5 Replies)
Discussion started by: chimpu
5 Replies

3. Shell Programming and Scripting

How to exclude folders/files in search?

I have a directory with about 20 folders and many different types of files. I need to search for files and gzip in all the directories except for 1 directory. How do you exclude a directory? (2 Replies)
Discussion started by: bbbngowc
2 Replies

4. Shell Programming and Scripting

Making 99 folders 99 folders deep

I am trying to make a unix shell script that will make 99 folders 99 deep (counting the first level folders). So far i have made it make the first 99 folders and 99 more in all of the folders. The only problem is the only way i have found is copying and pasting part of the script over and over and... (18 Replies)
Discussion started by: YukonAppleGeek
18 Replies

5. UNIX for Dummies Questions & Answers

Searching for folders/parent folders not files.

Hello again, A little while back I got help with creating a command to search all directories and sub directories for files from daystart of day x. I'm wondering if there is a command that I've overlooked that may be able to search for / write folder names to an output file which ideally... (2 Replies)
Discussion started by: Aussiemick
2 Replies

6. Ubuntu

[Solved] Using Find with an exclude/exclude file

I am familiar with using tar and exclude/include files: tar zcf backup.dirs.tgz --files-from=include.mydirs --exclude-from=exclude.mydirs --no-recursion but was wondering if I could use find in the same way. I know that you can just specify the directories to exclude but my list is... (2 Replies)
Discussion started by: metallica1973
2 Replies

7. Shell Programming and Scripting

Grep for a srting & exclude two folders

Hi, Below is the command to grep for a string under grep -r "redeem" /home/tom Need to make it case insensitive and exclude logs & tmp folders under /home/tom directory in my Search. Need this in Linux. (1 Reply)
Discussion started by: mohtashims
1 Replies

8. Shell Programming and Scripting

Copy between two different folders containing same sub-folders

I have a folder like this ls input1 dir1 dir2 dir3 file1 file2 file3 dir1, dir2 and dir3 are sub-folders inside the folder input1 ls input2 dir1 dir2 dir3 file1 file2 file3 My dir1 in input1 folder has files f1, f2, f3 and f4. My dir1 in input2 folder has file f4 and f5. ... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

9. UNIX for Dummies Questions & Answers

Archive folders and sub folders

Hi Can i archive folder and folders in with the tar command My files are located in subfolders Eg: Folder1/Folder1_1/*.pdf Folder1/Folder1_2/*.pdf Folder1/Folder1_3/*.pdf so i would like to tar all the files in Folder1_1 and Folder1_2 only not Folder1_3 that should be done next... (2 Replies)
Discussion started by: cnrj
2 Replies

10. Shell Programming and Scripting

How to copy files/folders and show the files/folders?

Hi, So i know we use cp -r as a basic to copy folders/files. I would like this BUT i would like to show the output of the files being copied. With the amazing knowledge i have i have gone as far as this: 1) find source/* -exec cp -r {} target/ \; 2) for ObjectToBeCopied in `find... (6 Replies)
Discussion started by: Imre
6 Replies
STRUCT 
RIO_OPS(9) Internals STRUCT RIO_OPS(9) NAME
struct_rio_ops - Low-level RIO configuration space operations SYNOPSIS
struct rio_ops { int (* lcread) (struct rio_mport *mport, int index, u32 offset, int len,u32 *data); int (* lcwrite) (struct rio_mport *mport, int index, u32 offset, int len,u32 data); int (* cread) (struct rio_mport *mport, int index, u16 destid,u8 hopcount, u32 offset, int len, u32 *data); int (* cwrite) (struct rio_mport *mport, int index, u16 destid,u8 hopcount, u32 offset, int len, u32 data); int (* dsend) (struct rio_mport *mport, int index, u16 destid, u16 data); int (* pwenable) (struct rio_mport *mport, int enable); int (* open_outb_mbox) (struct rio_mport *mport, void *dev_id,int mbox, int entries); void (* close_outb_mbox) (struct rio_mport *mport, int mbox); int (* open_inb_mbox) (struct rio_mport *mport, void *dev_id,int mbox, int entries); void (* close_inb_mbox) (struct rio_mport *mport, int mbox); int (* add_outb_message) (struct rio_mport *mport, struct rio_dev *rdev,int mbox, void *buffer, size_t len); int (* add_inb_buffer) (struct rio_mport *mport, int mbox, void *buf); void *(* get_inb_message) (struct rio_mport *mport, int mbox); int (* map_inb) (struct rio_mport *mport, dma_addr_t lstart,u64 rstart, u32 size, u32 flags); void (* unmap_inb) (struct rio_mport *mport, dma_addr_t lstart); }; MEMBERS
lcread Callback to perform local (master port) read of config space. lcwrite Callback to perform local (master port) write of config space. cread Callback to perform network read of config space. cwrite Callback to perform network write of config space. dsend Callback to send a doorbell message. pwenable Callback to enable/disable port-write message handling. open_outb_mbox Callback to initialize outbound mailbox. close_outb_mbox Callback to shut down outbound mailbox. open_inb_mbox Callback to initialize inbound mailbox. close_inb_mbox Callback to shut down inbound mailbox. add_outb_message Callback to add a message to an outbound mailbox queue. add_inb_buffer Callback to add a buffer to an inbound mailbox queue. get_inb_message Callback to get a message from an inbound mailbox queue. map_inb Callback to map RapidIO address region into local memory space. unmap_inb Callback to unmap RapidIO address region mapped with map_inb. AUTHOR
Matt Porter <mporter@kernel.crashing.org>, <mporter@mvista.com> Author. COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 STRUCT RIO_OPS(9)
All times are GMT -4. The time now is 04:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy