07-19-2007
Quote:
Originally Posted by
aajan
By doing so, it wil count the directories also my dear pal
You are right, that would include directories as well.
My awk command should do then !
Thanks for pointing it out !
10 More Discussions You Might Find Interesting
1. AIX
I want to serch for a string in all the files in the root directory. i want the search to be limited to only the files in the directory i.e the search to be done only in the files not in the sub directory.
the approaches tried are
1)grep "pattern string"
this command was serching the... (3 Replies)
Discussion started by: Subbu_Angeline
3 Replies
2. UNIX for Dummies Questions & Answers
Hi Gurus
WHat would be the command to check whether there is a file in particular path or not..
for ex: my file name is ExRate_20071501.csv
I can have many files with same pattern but diffrentiated by date..
i have a process where i have to check if files exist in tht folder i have to... (5 Replies)
Discussion started by: sish78
5 Replies
3. Solaris
I am using the following Command to delete Directory with contents. But this command is deleting inside files only not directories. is there any change need in my command?
find -type f -mtime +3 -exec rm -r {} \;
Thanks (3 Replies)
Discussion started by: bmkreddy
3 Replies
4. Shell Programming and Scripting
I want the output of the find command to be printed and also the total files found by it. Can someone help in this.
Obviously $ find . -type f | wc -l will not output the files found but only the count. I want both. There can be millions and trillions of files so dont want the output of find... (3 Replies)
Discussion started by: amicon007
3 Replies
5. Shell Programming and Scripting
Hi All,
I am using the awk command to replace ',' by '\t' (tabs) in a csv file. I would like to apply this to all .csv files in a directory and create .txt files with the tabs.
How would I do this in a script?
I have the following script called "csvtabs":
awk 'BEGIN {
FS... (4 Replies)
Discussion started by: ScKaSx
4 Replies
6. UNIX for Dummies Questions & Answers
I did this:
ls -lrRt | grep ^* | cksum *
but it is showing cksum of sub-directories.
Thanks You
Please use code tags when posting data and code samples, thank you. (3 Replies)
Discussion started by: ezee
3 Replies
7. Shell Programming and Scripting
Hi,
I have a situation to compare one file, say file1.txt with a set of files in directory.The directory contains more than 100 files.
To be more precise, the requirement is to compare the first field of file1.txt with the first field in all the files in the directory.The files in the... (10 Replies)
Discussion started by: anandek
10 Replies
8. Shell Programming and Scripting
Hi Forum,
I am using the below command to find files older than x days in a directory excluding subdirectories. From the previous forums I got to know that prune command helps us not to descend in subdirectories. Though I am using it here, not getting the desired result.
cd $dir... (8 Replies)
Discussion started by: jhilmil
8 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I am trying to write a script to find some files in a directory
Example: if i have files like
2014-02-01_aaaa.txt
2014-02-01_bbbb.txt
2014-02-01_cccc.txt
2014-02-01_dddd.txt and some other files how can i just check to see if there four files exits or not i tried some thing like this... (5 Replies)
Discussion started by: vikatakavi
5 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I have a main folder 'home'. Lets say there is a folder 'bin' under 'home'. I want to check the list of files under subdirectories present under the /bin directory created in the last 24 hours.
I am using the following find command under home/bin directory:
find . -mtime -1 -print
... (3 Replies)
Discussion started by: DJose
3 Replies
dcheck(8) System Manager's Manual dcheck(8)
NAME
dcheck - Checks directory consistency
SYNOPSIS
/usr/sbin/dcheck [-i inumbers] [filesystem]
OPTIONS
The -i option is specified with a list of inumbers. If a specified inumber is found in a directory, the dcheck command displays the inum-
ber, the inumber of the directory, and the name of the entry.
DESCRIPTION
The fsck command supersedes the dcheck command for normal consistency checking.
The dcheck command reads the directories in a file system and compares the link-count in each inode with the number of directory entries by
which it is referenced. If a file system is not specified, a set of default file systems is checked.
To get optimum performance, specify the raw version of the special file because the ilist is read in large chunks.
RESTRICTIONS
Because the dcheck command uses two passes to check directories, it may produce erroneous diagnostics if active file systems are checked.
ERRORS
If a file is found and the link-count and the number of directory entries do not agree, dcheck reports relevant information. Allocated
files that have 0 link-count and no entries are also listed. A potentially dangerous situation occurs if there are more entries than links.
If entries are removed and the link-count drops to zero (0), the remaining entries point to nothing should be removed. If there are more
links than entries or if there is an allocated file with neither links nor entries, some disk space may be lost.
SEE ALSO
Commands: clri(8), fsck(8), icheck(8), ncheck(8)
Files: fs(4)
dcheck(8)