Sponsored Content
Top Forums Shell Programming and Scripting removing old files except configuration files and folders Post 302142661 by jamcalicut on Monday 29th of October 2007 04:38:55 AM
Old 10-29-2007
removing old files except configuration files and folders

Dear all,
I want to remove files older than 2 months in the /home/member directory. But except the configuration files (like .bash_profile .config/ .openoffice/ .local/ .kde/ etc..)

I have tried with the command
find . -mtime +60 -wholename './.*' -prune -o -print -exec mv {} \;
but it deletes newer files also.


thanks
 

9 More Discussions You Might Find Interesting

1. HP-UX

to get the timestamp of files from the files and folders in Unix

Hi, I had a directory and many subdirectories and files with in it. Now i want to get the timestamp of files from the files and folders recursively. :( Please help me to generate a script fort he above mentioned requirement! Appreciate for ur qick response Thanks in advance! ... (2 Replies)
Discussion started by: kishan
2 Replies

2. Red Hat

how to remove inner files without removing child folders

Hi, I want to write a command to remove all the files from a folder and inner child folder without removing the child folders of parent folder. like I have folder like this... folder a/b/c file a/test.sql file a/b/test2.txt file a/b/c/temp.jpeg now I want to remove all... (2 Replies)
Discussion started by: mkashif
2 Replies

3. Shell Programming and Scripting

how to remove inner files without removing child folders

Hi, I want to write a command to remove all the files from a folder and inner child folder without removing the child folders of parent folder. like I have folder like this... Code: folder a/b/c file a/test.sql file a/b/test2.txt file a/b/c/temp.jpeg now I want to remove... (5 Replies)
Discussion started by: mkashif
5 Replies

4. Shell Programming and Scripting

Compare 2 folders to find several missing files among huge amounts of files.

Hi, all: I've got two folders, say, "folder1" and "folder2". Under each, there are thousands of files. It's quite obvious that there are some files missing in each. I just would like to find them. I believe this can be done by "diff" command. However, if I change the above question a... (1 Reply)
Discussion started by: jiapei100
1 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. Shell Programming and Scripting

List all the files in the present path and Folders and subfolders files also

Hi, I need a script/command to list out all the files in current path and also the files in folder and subfolders. Ex: My files are like below $ ls -lrt total 8 -rw-r--r-- 1 abc users 419 May 25 10:27 abcd.xml drwxr-xr-x 3 abc users 4096 May 25 10:28 TEST $ Under TEST, there are... (2 Replies)
Discussion started by: divya bandipotu
2 Replies

7. Shell Programming and Scripting

Files with same names in different folders

Hello, I am looking for a command line that can do some operations on two files that have the same names but in different folders. for example if folder A contains files 1.txt, 2.txt, 3.txt,.. folder B contains files 1.txt, 2.txt, 3.txt,.. If I would like to concatenate the two files... (6 Replies)
Discussion started by: Mohamed EL Hadi
6 Replies

8. 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

9. UNIX for Beginners Questions & Answers

Find and removing the old files and zipping the files using shell script

Hi, I am trying to removing the old files which were older than 10 days and same g zipping the files using the shell script. script was return as follows. find /jboss7_homes/JBOSS7/SKYLIV??/SKYLIV??_CRM/jboss-eap-7.0/standalone/log -mtime +10 -type f | xargs rm -f find /cer_skyliv??/log... (6 Replies)
Discussion started by: venkat918
6 Replies
uuclean(8c)															       uuclean(8c)

Name
       uuclean - uucp spool directory clean-up

Syntax
       uuclean -p[pre] [ options ... ]

Description
       The  command  scans the spool directory for files with the specified prefix and deletes all those which are older than the specified number
       of hours.

       The -ppre argument causes the command to scan for files with pre as the file prefix.  You can specify up to 10 arguments.   A  without  any
       pre following causes all files older than the specified time to be deleted.  You must specify at least one argument.

Options
       -ntime	    Delete  all  files	whose age is more than time, in hours, (default is 72 hours) and that have the specified pre as their file
		    prefix.

       -m	    Send mail to the owner of the file when it is deleted.

       -ssystem     Delete files in all directories that are subdirectories of the per system spool directory that exists for system.  If  ALL	is
		    specified, then all system directories are processed.  ALL is the default.

       -ddirectory  Delete files that reside in the named directory.  The default directory is The option over rides the option.

       The  command typically starts the program.  In earlier versions, a deleted work file (C.file) would result in mail to the owner of the work
       file, regardless of the option.	Now, notification of deleted work files is sent to the user ID "uucp".	If the option  is  used,  mail	is
       also sent to the owner.

Examples
       Here are some example command lines:
       # uuclean -pLTMP. -pLOG. -n4 -d/usr/spool/uucp
       # uuclean -d/usr/spool/uucp/.XQTDIR -p -n
       # uuclean -smarkie -p -n84
       The third example deletes all files for the system that are older than 84 hours.

Files
       Directory with commands used by uuclean internally

See Also
       uucp(1c), uux(1c), cron(8)

																       uuclean(8c)
All times are GMT -4. The time now is 08:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy