find "/path" -type f -ctime +30


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Answers to Frequently Asked Questions find "/path" -type f -ctime +30
# 1  
Old 07-14-2015
find "/path" -type f -ctime +30

When I use the command
Code:
find "/abc/xyz" -type f -ctime +30

getting the error as
Code:
find:"/abc/xyz /lost+found: Permission Denied"

I tired
Code:
find  "/abc/xyz" -type d \( ! lost+found \)  -type f  -ctime +30

The error is
Code:
find: paths must precede expression Usage: find [-H] [-L] [-P] [path...] [expression]

Tried
Code:
find  "/abc/xyz" -maxdepth 1  -type f  -ctime +30

it is searching in current directory, but I have sub directories in /xyz folder

Could any one help me how to solve the issue.

Thanks in advance,

Last edited by Don Cragun; 07-14-2015 at 05:00 AM.. Reason: Add CODE and ICODE tags.
# 2  
Old 07-14-2015
Perhaps something more like:
Code:
find  "/abc/xyz" \( -name lost+found -prune \) -o -type f -ctime +30

would work better for you.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find . -path "*_nobackup*" -prune -iname "*.PDF" \( ! -name "*_nobackup.*" \)

These three finds worked as expected: $ find . -iname "*.PDF" $ find . -iname "*.PDF" \( ! -name "*_nobackup.*" \) $ find . -path "*_nobackup*" -prune -iname "*.PDF" They all returned the match: ./folder/file.pdf :b: This find returned no matches: $ find . -path "*_nobackup*" -prune... (3 Replies)
Discussion started by: wolfv
3 Replies

2. Shell Programming and Scripting

What is wrong with 'find . -maxdepth 1 -ctime -7 -type f'?

Have you tried running the command below? On the same RHEl 6.8 or 6.6. It will give you different output. find . -maxdepth 1 -ctime -7 -type f rpm -qa|grep find findutils-4.4.2-9.el6.x86_64 # cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.8 (Santiago) # (6 Replies)
Discussion started by: invinzin21
6 Replies

3. Shell Programming and Scripting

Find lines with "A" then change "E" to "X" same line

I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies

4. Shell Programming and Scripting

Using sed to find text between a "string " and character ","

Hello everyone Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies

5. Shell Programming and Scripting

"find . -printf" without prepended "." path? Getting path to current working directory?

If I enter (simplified): find . -printf "%p\n" then all files in the output are prepended by a "." like ./local/share/test23.log How can achieve that a.) the leading "./" is omitted and/or b.) the full path to the current directory is inserted (enclosed by brackets and a blank)... (1 Reply)
Discussion started by: pstein
1 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. UNIX for Advanced & Expert Users

Command to find the "unix machine type".

Hi all, Just need some help the following scenario, Is there any UNIX command to find the unix machine type (like whether the machine is belongs to Ssun ultra 45 type) like that .. please help me (2 Replies)
Discussion started by: abhisheksunkari
2 Replies

8. Shell Programming and Scripting

Creating a Shortcut (to just type "l" but it runs "ls -lah")

How do I create shortcuts? For example: I just want to type one key "l" and have it output the command of "ls -lah" I believe it's creating a file called l with 755 permissions but I'm not sure where to put the file. *if it matters, I'm on a shared hosting web server using cPanel with... (2 Replies)
Discussion started by: ijustsawmars
2 Replies

9. Shell Programming and Scripting

"find command" to find the files in the current directories but not in the "subdir"

Dear friends, please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories.. it is like this, current directory contains file1, file2, file3, dir1, dir2 and dir1 conatins file4, file5 and dir2 contains file6,... (9 Replies)
Discussion started by: swamymns
9 Replies

10. Shell Programming and Scripting

grep to find content in between curly braces, "{" and "},"

problem String ~~~~~~~~~~~~~~~~~~ icecream= { smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" } aend = {smart vc4 eatr kalu} output needed ~~~~~~~~~~~~~~~~~~ smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" smart vc4... (4 Replies)
Discussion started by: keshav_rk
4 Replies
Login or Register to Ask a Question