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
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)
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)
I need to delete a folder and files in it of yesterdays and simply put this in cron.
Folder name - "2010-03-2010"
File name - "eprod_06_23.dmp" and "eprod_06_23.exp"
Actually this folder and file is been created by a script which takes a backup of DB everyday.Thats why it creates folder and file... (3 Replies)
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)
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)
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)
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)
hi,
i have a requirement to delete all the files from all the directories except some specific directories like archive and log.
for example:
there are following directories such as
A B C D Archive E Log F
which contains some sub directories and files. The requirement is to delete all the... (7 Replies)
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
LEARN ABOUT V7
mhpath
MHPATH(1) [nmh-1.5] MHPATH(1)NAME
mhpath - print full pathnames of nmh messages and folders
SYNOPSIS
mhpath [+folder] [msgs] [-version] [-help]
DESCRIPTION
mhpath expands and sorts the message list `msgs' and writes the full pathnames of the messages to the standard output separated by new-
lines. If no `msgs' are specified, mhpath outputs the current mail folder's pathname instead. If the only argument is `+', your nmh
"Path" is output; this can be useful in shell scripts.
Contrasted with other nmh commands, a message argument to mhpath may often be intended for writing. Because of this:
1) the name "new" has been added to mhpath's list of reserved message names (the others are "first", "last", "prev", "next", "cur", and
"all"). The new message is equivalent to the message after the last message in a folder (and equivalent to 1 in a folder without mes-
sages). The "new" message may not be used as part of a message range.
2) Within a message list, the following designations may refer to messages that do not exist: a single numeric message name, the single
message name "cur", and (obviously) the single message name "new". All other message designations must refer to at least one existing
message, if the folder contains messages.
3) An empty folder is not in itself an error.
A message number less than that of the smallest existing message in a folder is treated as if the message already exists. A message number
greater than that of the highest existing message in a folder causes an "out of range" error message to be displayed.
As part of a range designation that contains messages that do exist, message numbers less than the smallest, or greater than the highest,
existing message in a folder are ignored.
Examples: The current folder foo contains messages 3 5 6. Cur is 4.
% mhpath
/r/phyl/Mail/foo
% mhpath all
/r/phyl/Mail/foo/3
/r/phyl/Mail/foo/5
/r/phyl/Mail/foo/6
% mhpath 2001
mhpath: message 2001 out of range 1-6
% mhpath 1-2001
/r/phyl/Mail/foo/3
/r/phyl/Mail/foo/5
/r/phyl/Mail/foo/6
% mhpath new
/r/phyl/Mail/foo/7
% mhpath last new
/r/phyl/Mail/foo/6
/r/phyl/Mail/foo/7
% mhpath last-new
mhpath: bad message list last-new
% mhpath cur
/r/phyl/Mail/foo/4
% mhpath 1-2
mhpath: no messages in range 1-2
% mhpath first:2
/r/phyl/Mail/foo/3
/r/phyl/Mail/foo/5
% mhpath 1 2
/r/phyl/Mail/foo/1
/r/phyl/Mail/foo/2
mhpath is also useful in back-quoted operations:
% cd `mhpath +inbox`
% echo `mhpath +`
/r/phyl/Mail
FILES
$HOME/.mh_profile The user profile
PROFILE COMPONENTS
Path: To determine the user's nmh directory
Current-Folder: To find the default current folder
SEE ALSO folder(1)DEFAULTS
`+folder' defaults to the current folder
`msgs' defaults to none
CONTEXT
None
BUGS
Like all nmh commands, mhpath expands and sorts [msgs]. So don't expect
mv `mhpath 501 500`
to move 501 to 500. Quite the reverse. But
mv `mhpath 501` `mhpath 500`
will do the trick.
Out of range message 0 is treated far more severely than large out of range message numbers.
MH.6.8 11 June 2012 MHPATH(1)