Hi,
I need to delete an empty directory in a temp directory except "dir5" (keep everything that is not empty).
Plese advise.
Here is an example of my directory.
/dir/temp/
dir1 - delete if this is empty
dir2 - delete if this is empty
dir3 - delete if this is empty
dir4 - delete if this... (7 Replies)
I know this one was answered before in forum below -
https://www.unix.com/unix-dummies-questions-answers/58210-removing-empty-folders-using-find-command.html
But that one is closed & I have a question so here it goes.
I want to delete all 2006 files. Now if along with the files, if the... (2 Replies)
Hello:
I searched here for "vi -c" but found no hits.
How can I use vi -c to remove ALL empty lines, regardless of how many?
I tried
<code>
vi -c ":g/^$/d | wq" filename
</code>
but I have to run it several times.
This is NOT homework. :)
Thanks for your time. (3 Replies)
Hi all,
I'm trying to remove when this condition is met: an empty and the next one
I'm using this command:
sed '/^$/N; s/&//' file
Which searches for an empty line, N attaches it to the next line, and substituing the combination with nothing.... but it is not working.
What I'm missing... (1 Reply)
Hi all !
I'm sure it is a basic question but I didn't find any threads that fit my need.
How to remove empty fields with awk?
Or in other words, how to shift all the fields after an empty field on the left?
input:
1|2||3|4|5||6
wanted:
1|2|3|4|5|6
I tried:
awk '{for(i=1; i<=NF;... (7 Replies)
Hello:
Is there a simple way to remove empty records of FASTA format file?
A FASTA format consists of two parts: header and sequence (for non-biologist, Wiki for details of course!). The header always start with ">" for the name of the sequence. The header must be in this ONLY single line.... (9 Replies)
Hi gurus,
I have a script which works fine.
https://www.unix.com/shell-programming-and-scripting/239347-how-pass-string-into-sql-query.html
while read p
do
&& para="'${p}'" || para="${para},'${p}'"
done < filePlease use code tags as required by forum rules!
a few days... (6 Replies)
Discussion started by: ken6503
6 Replies
LEARN ABOUT REDHAT
rmdir
RMDIR(2) Linux Programmer's Manual RMDIR(2)NAME
rmdir - delete a directory
SYNOPSIS
#include <unistd.h>
int rmdir(const char *pathname);
DESCRIPTION
rmdir deletes a directory, which must be empty.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
ERRORS
EPERM The filesystem containing pathname does not support the removal of directories.
EFAULT pathname points outside your accessible address space.
EACCES Write access to the directory containing pathname was not allowed for the process's effective uid, or one of the directories in
pathname did not allow search (execute) permission.
EPERM The directory containing pathname has the sticky-bit (S_ISVTX) set and the process's effective uid is neither the uid of the file to
be deleted nor that of the directory containing it.
ENAMETOOLONG
pathname was too long.
ENOENT A directory component in pathname does not exist or is a dangling symbolic link.
ENOTDIR
pathname, or a component used as a directory in pathname, is not, in fact, a directory.
ENOTEMPTY
pathname contains entries other than . and .. .
EBUSY pathname is the current working directory or root directory of some process.
ENOMEM Insufficient kernel memory was available.
EROFS pathname refers to a file on a read-only filesystem.
ELOOP Too many symbolic links were encountered in resolving pathname.
CONFORMING TO
SVr4, SVID, POSIX, BSD 4.3
BUGS
Infelicities in the protocol underlying NFS can cause the unexpected disappearance of directories which are still being used.
SEE ALSO rename(2), mkdir(2), chdir(2), unlink(2), rmdir(1), rm(1)Linux 0.99.7 1993-07-24 RMDIR(2)