I'm trying to figure out a way to delete empty files in a directory. I have a cron that runs and creates a flat file every 15 mins. However, most times at night the flat file will be empty.
I'd like to run a script to delete empty files that end with *.dat
Any suggestions?
Rich (1 Reply)
I am using the following Command to delete Directory with contents. But this command is deleting inside files only not directories. is there any change need in my command?
find -type f -mtime +3 -exec rm -r {} \;
Thanks (3 Replies)
Hi all,
Can you tell me how to empty all files in a directory with a "find" command?
It does not seem to work the way I try it:
# ls -l *.dat
-rw-r--r-- 1 root root 7 Jul 20 20:51 la2.dat
-rw-r--r-- 1 root root 4 Jul 20 20:51 la.dat
# find... (9 Replies)
What I'm trying to do is write a bash file that prompts for the user's name and what the want to name the output file. If nothing is entered in either prompt the script must end and not create the output file. This is what I have so far:
#!/bin/sh
echo "What is your name?"
read NAME
if
... (4 Replies)
I'm trying to write a shell script to files of zero length in a specified directory, but I keep getting errors. Would anybody be kind enough to look it over for issues? Thanks a bunch in advance.
#!/bin/sh
if
then
if
then
find $1 -type f -size 0 -print|xargs rm
exit 0... (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Need to make a script, to remove all empty files and folders from current category.
It also should show the name... (2 Replies)
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)
Need a ksh script to get the files that were created or modified in a directory on a particular date entered by the user.
For example if a directory contains files as below :
> ll
total 41
-rw-rw-r-- 1 psn psn 199 Aug 23 07:06 psn_roll.sh
-rw-rw-r-- 1 psn psn ... (10 Replies)
Hello Friends,
I have directory called /tmp. which stores the log files.
Whenever it becomes full, i want to delete half of files from all log files.
even after deleting the files, if space is more than 90% then it should delete rest of half files.
While deleting files, older files... (7 Replies)
Hi,
I need help in regard to developing a shell script to delete empty files from multiple specific locations. The directory paths will be stored in a text file. So the requirement is to read the text file for one specific path and then remove empty files from that particular path. Looping through... (4 Replies)
Discussion started by: Khan28
4 Replies
LEARN ABOUT OSX
uupick
uupick(8) System Manager's Manual uupick(8)NAME
uupick - retrieve files transferred by uuto
SYNOPSIS
uupick [-s system] [--system system]
DESCRIPTION
The uupick program is used to conveniently retrieve files transferred by the uuto program.
For each file transferred by uuto, uupick will display the source system, the file name, and whether the name refers to a regular file or a
directory. It will then wait for the user to specify an action to take. One of the following commands must be entered:
`q'
Quit out of `uupick'.
`RETURN'
Skip the file.
`m [directory]'
Move the file or directory to the specified directory. If no
directory is specified, the file is moved to the current directory.
`a [directory]'
Move all files from this system to the specified directory. If no
directory is specified, the files are moved to the current
directory.
`p'
List the file on standard output.
`d'
Delete the file.
`! [command]'
Execute `command' as a shell escape.
OPTIONS -s system, --system system
Used to restrict `uupick' to only present files transferred from a particular system.
Standard UUCP options:
-x type, --debug type
Turn on particular debugging types. The following types are recognized: abnormal, chat, handshake, uucp-proto, proto, port, config,
spooldir, execute, incoming, outgoing.
-I file, --config
Set configuration file to use.
-v, --version
Report version information and exit.
--help
Print a help message and exit.
SEE ALSO uucp(1), uuto(1)AUTHOR
Ian Lance Taylor <ian@airs.com>. Text for this Manpage comes from Taylor UUCP, version 1.07 Info documentation.
Taylor UUCP 1.07 uupick(8)