I will like to write a script that delete all files that are older than 7 days in a directory and it's subdirectories. Can any one help me out witht the magic command or script?
Thanks in advance,
Odogboly98:confused: (3 Replies)
i have to delete files which are older than 15 days or more except the ones in the directory Current and also *.sh files
i have found the command for files 15 days or more older
find . -type f -mtime +15 -exec ls -ltr {} \;
but how to implement the logic to avoid directory Current and also... (3 Replies)
Hi all,
I want to delete log files with extension .log which are older than 30
days. How to delete those files?
Operating system -- Sun solaris 10
Your input is highly appreciated.
Thanks in advance.
Regards,
Williams (2 Replies)
Hi All,
I am using below code to delete files older than 2 days. In case if there are no files, I should log an error saying no files to delete.
Please let me know, How I can achive this.
find /path/*.xml -mtime +2
Thanks and Regards
Nagaraja. (3 Replies)
Hi All
I want to remove the files with name like data*.csv from the directory older than 10 days.
If there is no files exists to remove older than 10 days, It should not do anything.
Thanks
Jo (9 Replies)
As one of our requirement was to connect to remote Linux server through SFTP connection and delete some files which are older than 7 days.
I used the below piece of code for that,
SFTP_CONNECTION=`sftp user_id@host ...
cd DESIRED_DIR;
find /path/to/files* -mtime +5 -exec rm -rf {} \;
bye... (2 Replies)
Discussion started by: ATWC
2 Replies
LEARN ABOUT NETBSD
pwd
PWD(1) BSD General Commands Manual PWD(1)NAME
pwd -- return working directory name
SYNOPSIS
pwd [-LP]
DESCRIPTION
pwd writes the absolute pathname of the current working directory to the standard output.
The following options are available:
-L If the PWD environment variable is an absolute pathname that contains neither "/./" nor "/../" and references the current directory,
then PWD is assumed to be the name of the current directory.
-P Print the physical path to the current working directory, with symbolic links in the path resolved.
The default for the pwd command is -P.
pwd is usually provided as a shell builtin (which may have a different default).
EXIT STATUS
The pwd utility exits 0 on success, and >0 if an error occurs.
SEE ALSO cd(1), csh(1), ksh(1), sh(1), getcwd(3)STANDARDS
The pwd utility is expected to be conforming to IEEE Std 1003.1 (``POSIX.1''), except that the default is -P not -L.
BUGS
In csh(1) the command dirs is always faster (although it can give a different answer in the rare case that the current directory or a con-
taining directory was moved after the shell descended into it).
pwd -L relies on the file system having unique inode numbers. If this is not true (e.g., on FAT file systems) then pwd -L may fail to detect
that PWD is incorrect.
BSD October 30, 2003 BSD