Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Delete folders and files in it - UNIX Post 302404733 by amitranjansahu on Wednesday 17th of March 2010 06:20:02 AM
Old 03-17-2010
in script u can add the dynamic folder as a varible

DIR=`date '+DATE: %m-%d-%y%n' | awk '{ print $2 }'`

find /usr/mis/$DIR -mtime +1 -type f -exec rm -f {} \;

This is a example
Now check the man pages of date command to get the desired out put

Last edited by amitranjansahu; 03-17-2010 at 07:22 AM.. Reason: typo
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

delete all folders/files and keep only the last 10 in a folder

Hi, I want to write a script that deletes all folders and keep the last 10 recent folders. I know the following: ls -ltr will sort the folders from old to recent. ls -ltr | awk '{print $9}' will list the folder names (with a blank line at the beginning) I want to get the 10th folder from... (3 Replies)
Discussion started by: melanie_pfefer
3 Replies

2. Shell Programming and Scripting

delete files and folders older than 3 days

find /basedirectory -type f -mtime +3 >> /tmp/tempfile find /basedirectory -type d -mtime +3 >> /tmp/tempfile mailx -s "List of removed files and folders" myemail@domain.com < /tmp/te mpfile rm /tmp/tempfile find /basedirectory -type f -mtime +3 -exec rm {} \; find /basedirectory -type d... (7 Replies)
Discussion started by: melanie_pfefer
7 Replies

3. Shell Programming and Scripting

Compare files in two folders and delete missing ones

I do not know much about shell scripting so I am at a loss here. If someone can help me, that would be great! I have two directories /dir1 /dir2 I need to delete all files from /dir1 and that does not have a correspondent file in /dir2. It should NOT check file suffixes in /dir2 . Why?... (20 Replies)
Discussion started by: kaah
20 Replies

4. Shell Programming and Scripting

delete folders with no mpgs or nuv files

I need some help writing a simple script that will delete all subfolders that contain no mpg or nuv files, if they have anything else or are empty the folder should be deleted I got this far but I'm pretty hopeless foo=0 if then foo=1 fi if then foo=1 fi if then echo found... (9 Replies)
Discussion started by: mrplow
9 Replies

5. Shell Programming and Scripting

Loop folders, delete files, copy new ones

Folks, I am hopeful that you may be able to help me out with writing a script that can be run nightly (as cron?) to loop through all subfolders within the "/media" directory, delete all of the files in each of them, and then copy in all of the files from the "/home//sansa" directory to each of... (6 Replies)
Discussion started by: acraig
6 Replies

6. UNIX for Dummies Questions & Answers

[SOLVED] Delete files and folders under given directory

I have a requirement to delete the files and folders under a given directory. my directory structure is like this.. Data | A(Directory) |_PDF(Directory)----pdf files |_XML()Directory --xml files |--files | B(Directory) |_PDF(Directory)----pdf files |_XML()Directory --xml files ... (1 Reply)
Discussion started by: ramse8pc
1 Replies

7. Shell Programming and Scripting

Find and delete files and folders which are n days older from one unix server to another unix server

Hi All, Let me know how can i find and delete files from one unix server to another unix server which are 'N' days older. Please note that I need to delete files on remote unix server.So, probably i will need to use sftp, but question is how can i identify files and folders which are 'N'... (2 Replies)
Discussion started by: sachinkl
2 Replies

8. Shell Programming and Scripting

Script to delete folders and files from a prompt

Hi Everyone, I work for GE Money IVR as a DB analyst and the environment on which I work is Solaris 5.0 server and Oracle 11g. I got a project in which I have to clean up the folders and files which are not used in DB. I copied an existing script and edited it, dont know this is the... (5 Replies)
Discussion started by: habeeb506
5 Replies

9. UNIX for Advanced & Expert Users

Help with creating script to delete log files/folders

Hi I am new to Linux / scripting language. I need to improve our Linux servers at work and looking to claim some space my deleting log files/ folders on a 5 day basis. Can someone help me with creating a script to do so. Any sample script will be helpful.:b: Regards (2 Replies)
Discussion started by: sachinksl
2 Replies

10. Shell Programming and Scripting

Script to compare files in 2 folders and delete the large file

Hello, my first thread here. I've been searching and fiddling around for about a week and I cannot find a solution.:confused: I have been converting all of my home videos to HEVC and sometimes the files end up smaller and sometimes they don't. I am currently comparing all the video files... (5 Replies)
Discussion started by: Josh52180
5 Replies
GDOME2(1)							       0.8.1								 GDOME2(1)

NAME
gdome-config - script to get information about the installed version of gdome2 SYNOPSIS
gdome-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--libs] [--cflags] [--version] [--help] DESCRIPTION
gdome-config is a tool that is used to determine the compile and linker flags that should be used to compile and link programs that use gdome2. OPTIONS
gdome-config accepts the following options: --version Print the currently installed version of gdome2 on the standard output. --libs Print the linker flags that are necessary to link a gdome2 program. --cflags Print the compiler flags that are necessary to compile a gdome2 program. --prefix=DIR If specified, use DIR instead of the installation prefix that gdome2 was built with when computing the output for the --cflags and --libs options. This option must be specified before any --libs or --cflags options. --exec-prefix=DIR If specified, use DIR instead of the installation exec prefix that gdome2 was built when computing the output for the --cflags and --libs options. This option must be specified before any --libs or --cflags options. --help Print a short help text and exit. AUTHOR
This manual page was added by Enrico Zini <zinie@cs.unibo.it> for the Debian GNU/Linux system (but may be used by others). The page was made editing the manpage written by Fredrik Hallenberg <hallon@lysator.liu.se> for the libxml2 Debian GNU/Linux package. Version 3 December 2001 GDOME2(1)
All times are GMT -4. The time now is 03:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy