We can find zero size file using below comand if we want search 0 size and along with empty file
(File not contain any data may be space which is greater then 0 size ) want to remove
those file in my home directory
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)
Hi I need to write a shell script which basically searches for all the empty files within the directory structure, lists them before asking the user to confirm if they would like to delete them. If the user deletes the file then a notice would appear confirming the file is deleted.
I've be... (5 Replies)
Hi everyone,
really strange files keep appearing in my home directory. I have absolutely no idea where they come from and I'm a little concerned that they could come from some kind of malware activity or Firefox exploit. I searched Google for parts of the file names but without a result. The... (6 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)
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)
Hi,
I am newbie to Solaris and system administration in general, and I have a couple of questions about files in my HOME directory.
When I perform ls -la, I get the following list of files:
drwxr-xr-x 7 XXXYYY staff 17 Aug 24 07:31 .
drwxr-xr-x 7 root root 7... (2 Replies)
hey there folks! I cant figure out, for the life of me, how to procede in removing alll the files in my home directory that are not owned by me.
would i have to list them, but after that what do i do. or is there some way I am not aware of.
my employer heard i could script in unix, but i havent... (3 Replies)
I have a script, which is supposed to run 1 day of the month, connect to remote server certain directory, find files, tar the, and copy
find . -ctime -1 | tar -cvf transfer_dmz_start_monthly.tar *${Today}*.*;
if
then
echo "Cannot create a tar file, the terminated... (2 Replies)
Discussion started by: digioleg54
2 Replies
LEARN ABOUT ULTRIX
getcwd
getcwd(3) Library Functions Manual getcwd(3)Name
getcwd - get pathname of working directory
Syntax
char I**getcwd (buf, size)
char I**buf;
int size;
Description
The subroutine returns a pointer to the current directory pathname. The value of size must be at least two greater than the length of the
pathname to be returned.
If buf is a NULL pointer, will obtain size bytes of space using In this case, the pointer returned by may be used as the argument in a sub-
sequent call to free.
The function is implemented by using to pipe the output of the command into the specified string space.
Examples
char *cwd, *getcwd();
.
.
.
if ((cwd = getcwd((char *)NULL, 64)) == NULL) {
perror("pwd");
exit(1);
}
printf("%s
", cwd);
Return Values
Returns NULL with errno set if size is not large enough, or if an error occurs in a lower-level function.
Diagnostics
[EINVAL] The size argument is zero or negative.
[ERANGE] The size argument is greater than zero, but is smaller than the length of the pathname+1;
[EACCES] Read or search permission is denied for a component of the pathname.
[ENOMEM] Insufficient storage space is available.
See Alsopwd(1), malloc(3), popen(3)getcwd(3)