Thanks Franklin, it gave bad option warning for -empty. However cant i display the empty files before or after they are removed, like the above AWK command?
Hi
My problem is i have to remove some log files in specific named directories on a regular basis using shell scripts. What i want my shell script to do is i give the shell script some listing of directories from which to delete all log files recursively.
Can anyone please help me.
... (2 Replies)
Hi there,
I have a some directories containing web files that are old, and I need to remove them. I know that there might be sym links and hyperlinks pointing to these old directories. If that's the case, then I'll have to fix the links before deleting these old directories to avoid broken... (4 Replies)
as of our requiremnt some x no of files will be created from a third party tool ,out of them one or two files will be empty i.e size is 0. so i want to remove those files which are empty.
naming of the files which are created will be like this
abc_.txt 0 size
abc_1.txt 4000 size
abc_2.txt... (1 Reply)
Hello Gurus,
I want to delete only empty files (files with 0 bytes) at once from the local directory. Rightnow I need to go through all the files one by one manually and check the empty files before deleting them. Is there any unix command that finds and deletes empty files in a directory?... (5 Replies)
Hello, I'm submitting this thread, because I was looking a way to delete empty directories using find and I found a thread from 2007 that helped me. I have worked from that threat, but I found that the command sent would analyze original directory and may delete it to. I have come up with expanded... (3 Replies)
Hello out there,
I want to setup a crontab feature to remove temporary pdf files from sub directories that are older than 30 days. I want to presevere the directory structer though. I got this far for a command. Will this remove the pdf's in subdirectories or just directly under the pdf folder? If... (6 Replies)
Hi,
Seems like I need help again with a problem:
I want to delete all files from my lets say "Music" Directory inkluding all of the subfolders
except for .mp3 and .MP3 files.
I tried it with globalignoring mp3 files, finding and deleting all other files, which
resulted in all files... (3 Replies)
I have a log directory:
/logs/foo.log
/logs/bar.log
/logs/err.out
I'm trying to find a way to
> /logs/*.log
> /logs/*.out
to blank them out, but of course, that doesn't work.
Any suggestions? (4 Replies)
Hi
Can someone assist in writing a script.
I have a filesystem named /sybase in my aix lpar.
When this filesystem becomes 94% full all the files and directories under /sybase/logs should be deleted immediately. :confused: (7 Replies)
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)
Discussion started by: Itixop
2 Replies
LEARN ABOUT OPENDARWIN
badsect
BADSECT(8) BSD System Manager's Manual BADSECT(8)NAME
badsect -- create files to contain bad sectors
SYNOPSIS
/etc/badsect bbdir sector ...
DESCRIPTION
Badsect makes a file to contain a bad sector. Normally, bad sectors are made inaccessible by the standard formatter, which provides a for-
warding table for bad sectors to the driver; see bad144(8) for details. If a driver supports the bad blocking standard it is much preferable
to use that method to isolate bad blocks, since the bad block forwarding makes the pack appear perfect, and such packs can then be copied
with dd(1). The technique used by this program is also less general than bad block forwarding, as badsect can't make amends for bad blocks
in the i-list of file systems or in swap areas.
On some disks, adding a sector which is suddenly bad to the bad sector table currently requires the running of the standard DEC formatter.
Thus to deal with a newly bad block or on disks where the drivers do not support the bad-blocking standard badsect may be used to good
effect.
Badsect is used on a quiet file system in the following way: First mount the file system, and change to its root directory. Make a directory
BAD there. Run badsect giving as argument the BAD directory followed by all the bad sectors you wish to add. (The sector numbers must be
relative to the beginning of the file system, but this is not hard as the system reports relative sector numbers in its console error mes-
sages.) Then change back to the root directory, unmount the file system and run fsck(8) on the file system. The bad sectors should show up
in two files or in the bad sector files and the free list. Have fsck remove files containing the offending bad sectors, but do not have it
remove the BAD/nnnnn files. This will leave the bad sectors in only the BAD files.
Badsect works by giving the specified sector numbers in a mknod(2) system call, creating an illegal file whose first block address is the
block containing bad sector and whose name is the bad sector number. When it is discovered by fsck it will ask ``HOLD BAD BLOCK ?'' A posi-
tive response will cause fsck to convert the inode to a regular file containing the bad block.
SEE ALSO bad144(8), fsck(8), format(8)DIAGNOSTICS
Badsect refuses to attach a block that resides in a critical area or is out of range of the file system. A warning is issued if the block is
already in use.
BUGS
If more than one sector which comprise a file system fragment are bad, you should specify only one of them to badsect, as the blocks in the
bad sector files actually cover all the sectors in a file system fragment.
HISTORY
The badsect command appeared in 4.1BSD.
4th Berkeley Distribution June 5, 1993 4th Berkeley Distribution