08-26-2009
find . ! -name . -prune -mtime N
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I need to remove files (*.trc) which are older than 30 days from one location.
My problem is there I do not want to visit any of the directories at that location. I want to search files at that particular location only (need to skip directorys at that location). maxdepth option is there... (6 Replies)
Discussion started by: malaymaru
6 Replies
2. HP-UX
Hi,
My requirement is need to delete the directories (Including files also) which are older than 7 days. So I used below command in one script (script takes 2 input parameters)
#$1 - Path of the directory from where we have to delete the directories.#
#$2 - Number of days older... (1 Reply)
Discussion started by: sridhar sivakot
1 Replies
3. Shell Programming and Scripting
Hi All,
I've got a ton of files in a particular directory. I want to find pdf files older than 30 days in that directory and then the cumulative size of those files.
Ex:
find /home/jk/a -name "*.pdf" -mtime +30
consider it finds the below 4 files.
/home/jk/a/1.pdf
/home/jk/a/2.pdf... (1 Reply)
Discussion started by: rohan076
1 Replies
4. Red Hat
Hi,
I have dummies questions:
My script here can find the files in any directories older than 30 days then it will delete the files but not the directories. I would like to also be able to delete the directories that hold old files more than 30 days not just the files itself.
find . -type f... (2 Replies)
Discussion started by: lamoul
2 Replies
5. Shell Programming and Scripting
Hello,
Motive: Search all directories which are older than 5 days.
Example: consider following directory structure:
abc/dir1 abc/dir1/dir abc/dir2 abc/dir3 abc/dir3/temp
Suppose dir1 and dir3 are 5 days older. Then I am looking for a command which lists abc/dir1 and abic/dir3 only so that... (4 Replies)
Discussion started by: mytempid07
4 Replies
6. UNIX for Advanced & Expert Users
Hi Gurus,
I have command to delete more than 180days file.
find /home/abc/ -name "CBST_*.txt*" -mtime +180 | xargs -n 100 rm -f
Now I would like to delete more than 180days Non empty directory--What will be command?
Following is non empty directory as instance CBST2010* (2 Replies)
Discussion started by: thepurple
2 Replies
7. Shell Programming and Scripting
Need assistance in the perl script . Below script gives me the results of all the files and directories with mtime with no issues . But i wanted to have a file and specify all the directory locations and use that file as reference and get results . Any ideas are highly Appreciated .
... (6 Replies)
Discussion started by: ajayram_arya
6 Replies
8. UNIX for Dummies Questions & Answers
Hi all,
how to compress the directories which is older 7 days.
If any one knows please help me this is urgent.
Thanks in advance (3 Replies)
Discussion started by: rameshpagadala
3 Replies
9. Shell Programming and Scripting
Requirement is to list the files older than 365 days from multiple directories and delete them and log the list of files which are deleted to a log file.
so 1 script should only list files older than 365 days for each directory separately to a folder
The other script should read these files... (7 Replies)
Discussion started by: prasadn
7 Replies
10. Linux
Hi,
I am trying to run a command that finds all files over x amount of days, issue is one of the directories has spaces within it.
find /files/target directory/*/* -type f -mtime +60 When running the above the usual error message is thrown back
+ find '/files/target\' 'directory/*/*' -type... (1 Reply)
Discussion started by: Ads89
1 Replies
LEARN ABOUT OPENSOLARIS
xdg-user-dir
xdg-user-dir(1) User Commands xdg-user-dir(1)
NAME
xdg-user-dir - Get the path used for desktop user directory location.
SYNOPSIS
xdg-user-dir DIR
DESCRIPTION
xdg-user-dir is a utility that extracts the location of the specified desktop user directory from the file :
${HOME}/.config/user-dirs.dirs
OPERANDS
Valid desktop directories (DIR) are:
DESKTOP
DOWNLOAD
TEMPLATES
PUBLICSHARE
DOCUMENTS
MUSIC
PICTURES
VIDEOS
If an invalid directory is requested ${HOME} is returned.
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables:
HOME.
Other environment variable that are used are:
XDG_CONFIG_HOME
Base directory for storge of XDG configuration files. Defaults to ${HOME}/.config
FILES
The following files are used by this application:
/usr/bin/xdg-user-dir
XDG Directory expansion utility.
${XDG_CONFIG_HOME}/user-dirs.dirs
Location of the user-specific configuration including the current list of directories and what they map to.
EXAMPLES
Example 1: Location of user's documents directory
% xdg-user-dir DOCUMENTS
/home/user/Documents
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWxdg-user-dirs |
+-----------------------------+-----------------------------+
|Interface stability |Uncommitted |
+-----------------------------+-----------------------------+
SEE ALSO
More information can be found at:
http://www.freedesktop.org/wiki/Software/xdg-user-dirs
xdg-user-dirs-update(1), xdg-user-dirs-gtk-update(1), attributes(5)
NOTES
Written by Darren Kenny, Sun Microsystems Inc, 2008
SunOS 5.11 03 Apr 2008 xdg-user-dir(1)