02-06-2012
How to find empty files in a directory and write their file names in a text?
I need to find empty files in a directory and write them into a text file. Directory will contain old files as well, i need to get the empty files for the last one hour only.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
how can find length of file names in a directory.
Examp:
I have a directory with name "d1".
directory: d1
files:
aaa.log
bbb.log
abcd.log
abcdef.log
I wold like out put like:
file name legnth
aaa.log 3
bbb.log 3
abcd.log 4
abcdef.log 5 (5 Replies)
Discussion started by: koti_rama
5 Replies
2. Shell Programming and Scripting
Hi,
I have to perform an iterative function on a set of 10 files. After the first round the output files are named differently than the input files.
examples
input file name = xxxx1.yyy
output file name = xxxx1_0001.yyy
I need to rename all of the output files to the original input... (5 Replies)
Discussion started by: ligander
5 Replies
3. AIX
Hi,
I am trying to find the content of file using grep and find command and list only the file names
but i am getting entire file list of files in the directory
find . -exec grep "test" {} \; -ls
Can anyone of you correct this (2 Replies)
Discussion started by: madhu_Jagarapu
2 Replies
4. Shell Programming and Scripting
I have a script that generates a variable with the location of a file and its complete path. What i want to do is to "cd" to the directory where that file is located using the path name of the file. GIS has absolutely failed me.
For example when i run my script it generates a variable called... (1 Reply)
Discussion started by: Knome
1 Replies
5. Shell Programming and Scripting
Hi All,
I have some 50,000 HTML files in a directory. The problem is; some HTML files are duplicate versions that is wget crawled them two times and gave them file names by appending 1, 2, 3 etc after each crawl. For example, if the file index.html has been crawled several times, it has been... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies
6. UNIX for Dummies Questions & Answers
I would need a command for finding first 15000 of the file names whose 25th postion is 5 in the current directory alone.
I do have this painful command
find . -name '5*' | head -15000 | cut -c3-
please refine this.
Of course the above command also searches in the sub directories... (3 Replies)
Discussion started by: vk39221
3 Replies
7. Shell Programming and Scripting
got it figured out :) (1 Reply)
Discussion started by: sHockz
1 Replies
8. Shell Programming and Scripting
i want to display all the files which has their names in the Uppercase in a particular directory...guide.. (6 Replies)
Discussion started by: sheelsadan
6 Replies
9. UNIX for Advanced & Expert Users
Hi , Need to shell script to extracts files names and write those to another file in different directory.
input file is
inputfile.txt
abc|1|bcd.dat
123 david123
123 rudy2345
124 tinku5634
abc|1|def.dat
123 jevid123
123 qwer2345
124 ghjlk5634
abc|1|pqr.txt
123 vbjnnjh435
123 jggdy876... (9 Replies)
Discussion started by: dssyadav
9 Replies
10. Shell Programming and Scripting
If I have 5 files in a directory, what is the best way to remove specific files in it?
For example,
snps.ivg
probes.ivg
Desired output
probes.ivg
probes.txt
all.txt
Basically, removing those files with "snp" in the filename regardless of extension. Thank you :). (2 Replies)
Discussion started by: cmccabe
2 Replies
LEARN ABOUT ULTRIX
sticky
sticky(8) System Manager's Manual sticky(8)
Name
sticky - executable files with persistent text
Description
The sticky bit (file mode bit 01000), is used to indicate special treatment for certain executable files and directories.
While the sticky bit, mode 01000 is set on a sharable executable file, the text of that file will not be removed from the system swap area.
Thus the file does not have to be fetched from the file system upon each execution. As long as a copy remains in the swap area, the origi-
nal text cannot be overwritten in the file system, nor can the file be deleted. Directory entries can be removed so long as one link
remains.
Sharable files are made by the and options of
To replace a sticky file that has been used, clear the sticky bit with and execute the old program to flush the swapped copy. This can be
done safely even if others are using it. Overwrite the sticky file. If the file is being executed by any process, writing will be pre-
vented. It suffices to simply remove the file and then rewrite it, being careful to reset the owner and mode with and Set the sticky bit
again.
A directory whose sticky bit is set becomes an append-only directory, or, more accurately, a directory in which the deletion of files is
restricted. A file in a sticky directory may only be removed or renamed by a user if the user has write permission for the directory and
the user is the owner of the file, the owner of the directory, or the superuser. This feature is usefully applied to directories such as
which must be publicly writeable but should deny users the license to arbitrarily delete or rename each others' files.
Restrictions
Only the superuser can set the sticky bit.
See Also
chmod(2)
RISC sticky(8)