Hello,
I am new to unix and would like to have a count of all the files in the current directory as well as all the files in a subdirectory.
The command I used was ls -R | wc -l
but the number returned wasn't correct. Can someone please help?
Thanks (2 Replies)
Hi,
Please let me know how to find out number of files in a directory excluding existing files..The existing file format will be unknown..each time..
Thanks (3 Replies)
I am writing a bash script to find out all the files in a directory which are empty. I am running into multiple issues. I will really appreciate if someone can please help me.
#!/bin/bash
DATE=$(date +%m%d%y)
TIME=$(date +%H%M)
DIR="/home/statsetl/input/civil/test"
... (1 Reply)
Hi!
I just want to count number of files in a directory, and write to new text file, with number of files and their name
output should look like this,,
assume that below one is a new file created by script
Number of files in directory = 25
1. a.txt
2. abc.txt
3. asd.dat... (20 Replies)
hi I am trying to write a script to count the number of files, with slightly different subset name, in a directory
for example, in directory /data, there are a subset of files that are name as follow
/data/data_1_(1to however many).txt
/data/data_2_(1 to however many).txt... (12 Replies)
Hi All!
I need to have a script that counts the number of files arriving in a landing directory, them some app pick these files to be processed and load to a DB. But this process is so fast that I am not able to count all the files arriving on a landing directory.
Please can you help?
My... (6 Replies)
I'm writing a script for searching substring in file content and then moving found files. So far I've wrote script shown below
grep -lir 'stringtofind' $1 | xargs mv -t $2
How can i count number of files moved? (4 Replies)
Chaps, I need to count number of files in a remote directory from Linux (FreeBSD) as if 10 trace files (log files) been generated within 5min of time. So this is the script then I can setup a monitoring.
I came across with ls -1 \ip\d:\Logs | wc -l but then what else requires to check time... (8 Replies)
Discussion started by: samwijekoon
8 Replies
LEARN ABOUT MOJAVE
ftrylockfile
FLOCKFILE(3) BSD Library Functions Manual FLOCKFILE(3)NAME
flockfile, ftrylockfile, funlockfile -- stdio locking functions
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdio.h>
void
flockfile(FILE *file);
int
ftrylockfile(FILE *file);
void
funlockfile(FILE *file);
DESCRIPTION
These functions provide explicit application-level locking of stdio FILE objects. They can be used to avoid output from multiple threads
being interspersed, input being dispersed among multiple readers, and to avoid the overhead of locking the object for each operation.
The flockfile() function acquires an exclusive lock on the specified object. If another thread has already locked the object, flockfile()
will block until the lock is released.
The ftrylockfile() function is a non-blocking version of flockfile(); if the lock cannot be acquired immediately, ftrylockfile() returns non-
zero instead of blocking.
The funlockfile() function releases the lock on an object acquired by an earlier call to flockfile() or ftrylockfile().
These functions behave as if there is a lock count associated with each object. Each time flockfile() is called on the object, the count is
incremented, and each time funlockfile() is called on the object, the count is decremented. The lock is only actually released when the
count reaches zero.
RETURN VALUES
The flockfile() and funlockfile() functions return no value.
The ftrylockfile() function returns zero if the object was successfully locked, non-zero otherwise.
SEE ALSO getc_unlocked(3), putc_unlocked(3)STANDARDS
The flockfile(), ftrylockfile(), and funlockfile() functions conform to IEEE Std 1003.1-2001 (``POSIX.1'').
BSD January 10, 2003 BSD