Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Restricting a Find search to the current directory only Post 302639215 by methyl on Friday 11th of May 2012 10:44:29 AM
Old 05-11-2012
Please post what Operating System and version you have. There is much variation in the find command.

Have you tried:
Code:
-maxdepth 0

And:
Code:
-type f

Also, while you are testing ... just echo the command:
Code:
find . -daystart -maxdepth 0 -type f -mtime 2 -exec echo rm {} \;

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

find directory not including current

Using Solaris 8, I've forgotten how to exclude the current directory in the find results. find . -type d ! -name "*.CAP" I want every directory that does not match the *.CAP pattern, except the current directory. (2 Replies)
Discussion started by: dangral
2 Replies

2. UNIX for Dummies Questions & Answers

Question about Restricting Search path of FIND to current directory

Hi, By default FIND command searches for matching files in all the subdirectories within the specified path. Is there a way to restrict FIND command's search path to only the specified directory and NOT TO scan its subdirectories. Any help would be more than appreciated. Thanks and Regards (2 Replies)
Discussion started by: super_duper_guy
2 Replies

3. UNIX for Dummies Questions & Answers

how to stop to current directory using find

Hello, I just want to ask the following use of find command: 1. how can I find files only to the current directory? 2. how can I find files to directories and all subdiretories (are this include soft links?) but will not go to other mountpoints that is under that mountpoint. Im combining... (1 Reply)
Discussion started by: james_falco
1 Replies

4. UNIX for Dummies Questions & Answers

Restrict my search to current directory.

Hi every1, There is a folder with .lst files which has email id's of our project group. I want to find files which has my email id starting with sachin but i dont want find command to search subdirectories. I have read about prune but i didnt understand that. I am pretty new in this field.... (7 Replies)
Discussion started by: sachin.gangadha
7 Replies

5. Shell Programming and Scripting

non recursive search in the current directory only

Hi, Am trying for a script which should delete more than 15 days older files in my current directory.Am using the below piece of code: "find /tmp -type f -name "pattern" -mtime +15 -exec /usr/bin/ls -altr {} \;" "find /tmp -type f -name "pattern" -mtime +15 -exec /usr/bin/rm -f {} \;" ... (9 Replies)
Discussion started by: puppala
9 Replies

6. Shell Programming and Scripting

Restricting zip to current directory only

I am using the following command in a C shell script: find . -name "*.*" -print | zip $ProjectZipFile -@ to zip files in a Unix (Sun and/or Linux) directory for archiving purposes. This command works fine, the only problem being that if sub-directories are present, they are included in... (5 Replies)
Discussion started by: phudgens
5 Replies

7. UNIX for Dummies Questions & Answers

find command to look for current directory only

i have this find command on my script as: for i in `find $vdir -name "$vfile" -mtime +$pday` the problem with this code is that the sub-directories are included on the search. how do i restrict the search to confine only on the current directory and ignore the sub-directories. please advise.... (7 Replies)
Discussion started by: wtolentino
7 Replies

8. Homework & Coursework Questions

C Program to search and read all named pipes in current directory

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a C program to search the current directory for all pipes. 1. It will print the pipe... (2 Replies)
Discussion started by: natwickley
2 Replies

9. Shell Programming and Scripting

How to restrict Find only search the current directory?

hello, all I have googled internet, read the man page of Find, searched this forum, but still could not figure out how. My current directory is: little@wenwen:~$ pwd /home/little little@wenwen:~$ I want to use find command to list the files in my current directory, how should i write... (3 Replies)
Discussion started by: littlewenwen
3 Replies

10. Shell Programming and Scripting

Search: find current line, then search back

Hello. I want to find a line that has "new = 0" in it, then search back based on field $4 () in the current line, and find the first line that has field $4 and "last fetch" Grep or Awk preferred. Here is what the data looks like: 2013-12-12 12:10:30,117 TRACE last fetch: Thu Dec 12... (7 Replies)
Discussion started by: JimBurns
7 Replies
uucleanup(8)						      System Manager's Manual						      uucleanup(8)

NAME
uucleanup - Deletes selected old files from the uucp spool directory SYNOPSIS
uucleanup [options] FLAGS
If you specify one of the following flags, you must provide a value for days. The default value listed is used if the flag is not speci- fied. Removes any C.*(Command) files as old as or older than the number of days specified by days, and sends appropriate information to the requester. The default is 7 days. The -C and -W flags cannot be combined. Removes any D.*(Data) files as old as or older than the number of days specified in days. Also attempts to deliver any remaining mail messages. The default is 7 days. Includes a specified line of text in the warning message generated by the -W flag. The default line is: We have been unable to contact machine machine_name since you queued your job. The -m flag can be used only with the -W flag. Removes files in addition to those specified by the -C, -D, and -X flags that are as old as or older than the number of days specified in days. The default is 2 days. Executes uucleanup only on the spool directory specified by system. The default is to clean up all uucp spool directories. Note that system names can contain only ASCII characters. Removes TM.* (Temporary) files as old as or older than the number of days specified by the days argument. Also attempts to deliver any remaining mail messages. The default is 7 days. Sends a mail message to the requester warning that C*. files as old as or older than the number of days specified in days are still in the spool direc- tory. The message includes the job ID and, in the case of mail, the mail message. The administrator can use the -m flag to include a message line telling who to call to check the problem. The default is 1 day. Removes any X.*(Execute) files as old as or older than the number of days specified in days. The default is 2 days. Displays debugging information on the screen of the local termi- nal; level must be an integer from 0 to 9. The higher the number, the more detailed the debugging information. DESCRIPTION
The uucleanup program removes outdated files from the spool directory /usr/spool/uucp. The uucleanup program scans the /usr/spool/uucp spool directory for old files and takes appropriate action to remove them in a useful way. The uucleanup command performs the following tasks: Informs the requester of send/receive requests for systems that cannot be reached Warns users about requests that wait more than a specified number of days (the default is 1 day) Returns mail that cannot be delivered to the sender Removes all other files older than a specified number of days from the spool directory. The uucleanup program is not usually invoked from the command line, but is executed by the shell procedure uudemon.cleanu located in /usr/lib/uucp, which in turn is started by the cron script located in /usr/adm/cron/crontabs/uucp. Only someone with superuser privileges can issue the uucleanup command from the command line. To enable automatic cleanup, edit the file /usr/adm/cron/crontabs/uucp. Remove the # (number sign) from the beginning of the uude- mon.cleanu line. EXAMPLES
To locate files, enter: # uucleanup -W2 This form of the command locates C.* (Command) files 2 or more days old and warns the requesters that the files have not been sent. To send a message with a warning, enter: # uucleanup -W2 -mContact the System Admin about these files This form of the command locates C.* (Command) files 1 or more days old (the default), warns requesters their files have not been sent, and gives them the message: Contact the System Admin about these files. To clean up command files that are 8 or more days old, enter: # uucleanup -C8 This form of the command removes all C.* (Command) files 8 or more days old and sends an appropriate message to the requesters. Other uucp spool files are removed based on the default value for that type. To clean up data and execute files, enter: # uucleanup -D7 -X3 This form of the command removes all D.* (Data) files 7 or more days old (the default) and all X.* (Execute) files older than 3 days and attempts to deliver all undelivered mail. Remaining uucp spool files are removed based on the default value for that type. To clean up other files, enter: # uucleanup -o2 This form of the command removes uucp spool files according to their default values except for other files, which are removed if 2 days or older. To clean up all files at once, enter the command without flags: # uucleanup This form of the command removes all C.*, D.*, and X.* files, and all other files older than the default times. To clean up files for system hera, enter: # uucleanup -shera -C5 This form of the command removes all C.* files 5 or more days old and the other uucp spool files according to their default files for system hera (the files are in /usr/spool/uucp/hera/*). FILES
Specifies the command path. File that starts uudemon.cleanu shell procedure. Contains all the configuration files for uucp, and the uude- mon.cleanu shell procedure. Schedules uucp jobs for the cron daemon, including the uudemon.cleanu shell procedure. Contains files removed by the uucleanup command. RELATED INFORMATION
Commands: cron(8), uucp(1), uustat(1), uux(1) delim off uucleanup(8)
All times are GMT -4. The time now is 06:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy