Help with find and source directories


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with find and source directories
# 1  
Old 03-20-2012
Help with find and source directories

Hi,
How can i find the types of files in some directory(~/mydir) that start with word "fix" then followed by number 3, 4, 7 or 8 and end with .ccp or .in

How can i find the total number of files that are larger than 5000 bytes in specific directory?, I can do it by current directory by using
find -size +5000c -print | wc -l
but how to find in specific directory ex: /home/user

Thanks
# 2  
Old 03-20-2012
Hello,

Per our forum rules, all threads must have a descriptive subject text. For example, do not post questions with subjects like "Help Me!", "Urgent!!", "Doubt" or anything that does not accurately reflect the nature of your problem. Post subjects like "Execution Problems with Cron" or "Help with Backup Shell Script".

The reason for this is that nearly 95% of all visitors to this site come here because they are referred by a search engine. In order for future searches on your post (with answers) to work well, the subject field must be something useful and related to the problem!

In addition, current forum users who are kind enough to answer questions should be able to understand the essence of your query at first glance.

So, as a benefit and courtesy to current and future knowledge seekers, please be careful with your subject text. You might receive a forum infraction if you don't pay attention to this.

Thank you.

The UNIX and Linux Forums
# 3  
Old 03-20-2012
'find' takes one or more directories before the other arguments, allowing you to tell it precisely where to look inside.

-print is usually redundant, since it does that by default unless you've told it to take a different action like -exec.

Quote:
Originally Posted by kim1980
Hi,
How can i find the types of files in some directory(~/mydir) that start with word "fix" then followed by number 3, 4, 7 or 8 and end with .ccp or .in
Code:
find ~/mydir \( -name 'fix[3478]*.ccp' -o -name 'fix[3478]*.in' \)

Quote:
How can i find the total number of files that are larger than 5000 bytes in specific directory?, I can do it by current directory by using
find -size +5000c -print | wc -l
but how to find in specific directory ex: /home/user

Thanks
Code:
find ~/mydir -size +5000c | wc -l

# 4  
Old 03-20-2012
Quote:
Originally Posted by Corona688
'find' takes one or more directories before the other arguments, allowing you to tell it precisely where to look inside.

-print is usually redundant, since it does that by default unless you've told it to take a different action like -exec.



Code:
find ~/mydir \( -name 'fix[3478]*.ccp' -o -name 'fix[3478]*.in' \)



Code:
find ~/mydir -size +5000c | wc -l

Many thanks.

The first one gives me this error: Invalid expression; you have uesd a binary operator '-o' with nothing before it.
# 5  
Old 03-20-2012
Type it in more carefully, I think you missed the first -name.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to find particular word in directories?

Hello, i have multiple directories on my server. i need to find specific word like lets says for e.g IPV6 from those directories. can somebody tell me the right command which will let me to that? (8 Replies)
Discussion started by: Jared
8 Replies

2. Solaris

Way to find source of a kill -9 in Solaris

Hello Guys, Someone or, some tool has killed the application process with signal 9 (kill -9) . How to track that in Solaris? On AIX we can use light-weight tool called ProbeVue to track it but not sure how to do it on Solaris. Appreciate your help. Kelly (3 Replies)
Discussion started by: aixusrsys
3 Replies

3. HP-UX

Way to find source of a kill -9 in HP-UX

Hello Guys, Someone or, some tool has killed the application process with signal 9 (kill -9) . How to track that in HP-UX? On AIX we can use light-weight tool called ProbeVue to track it but not sure how to do it on HP-UX. Appreciate your help. Kelly Closed because this is... (0 Replies)
Discussion started by: aixusrsys
0 Replies

4. Red Hat

Help: Find established conn source

Hi Friends, On one of my server which having direct connection to internet without firewall ..am seeing a established connection with SSH .. am not getting how ..there no login but I can see this established connection . ## have hidden original IPs with below notations for security concerns .... (0 Replies)
Discussion started by: Shirishlnx
0 Replies

5. Shell Programming and Scripting

Find global variables, c source

Hello.I have been trying to solve the following problem, but to no avail. If anyone could please give me some indications, or anything, it would be amazing. A C source program and a type name are given. Determine from source, the list of the global variables having the given type. For each... (5 Replies)
Discussion started by: Susan78
5 Replies

6. UNIX for Dummies Questions & Answers

Using grep command to find the pattern of text in all directories and sub-directories.

Hi all, Using grep command, i want to find the pattern of text in all directories and sub-directories. e.g: if i want to search for a pattern named "parmeter", i used the command grep -i "param" ../* is this correct? (1 Reply)
Discussion started by: vinothrajan55
1 Replies

7. Shell Programming and Scripting

How to find 777 permisson is there or not for Directories and sub-directories

Hi All, I am Oracle Apps Tech guy, I have a requirement to find 777 permission is there or not for all Folders and Sub-folders Under APPL_TOP (Folder/directory) with below conditions i) the directory names should start with xx..... (like xxau,xxcfi,xxcca...etc) and exclude the directory... (11 Replies)
Discussion started by: gagan4599
11 Replies

8. Shell Programming and Scripting

gcc source in C language:WHERE I FIND THEM??

Hi, sorry for my english, i want to find the C-sources of the compiler gcc because i must create a compiler for an educational architecture made by my information technology professor. He told me that i must start from this sources, compile the gcc with them (pratically "auto-compile" the... (2 Replies)
Discussion started by: ferruccio87
2 Replies

9. Shell Programming and Scripting

find directories

I am looking a script which will find garbase directories (10 char. long)..which need to delete empty dir excluding symlink and system directories. I tried this partial script but it just find directories create a file which contains link directories..can somebody help me to complete this... (4 Replies)
Discussion started by: ddk2oo5
4 Replies

10. UNIX for Dummies Questions & Answers

help find wget, less, unzip source code

Where can I find the source code to basic unix core utilities like less, wget, and unzip? I'm on a HP-UX system that is missing a lot of basic tools. I Don't have admin access to the box. Google searches won't give me the source code. I would like to install some of the missing tools, like... (4 Replies)
Discussion started by: goldfish
4 Replies
Login or Register to Ask a Question