10-18-2006
Searching list of entries in file for actual files in dir
Hi all,
I have a file entries.txt that contains a number of entries all on seperate lines e.g.
test1
test2
test3
test4
Then in a directory called /TestFiles I have a number of files that could contain the above text in the file name
e.g. qwertytest1.csv qwertytest2.csv qwertytest3.csv
How can I search the entries.txt to see if if the entries exist in the TestFiles directory?
Thanks,
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
fjalkdsjfkldsajflkajdskl (3 Replies)
Discussion started by: pmeesara
3 Replies
2. Shell Programming and Scripting
I tried to make the title/subject detailed, but well.. have to keep it short as well.
I am wanting to take a large list of strings, and search through a large list of files to hopefully find numerous matches. I am not sure the quickest way to do this though.
// List of files
file1.txt... (2 Replies)
Discussion started by: Rhije
2 Replies
3. Shell Programming and Scripting
Is there a tool that can diff a directory and generate a change list of files in that directory based on a previous snapshot on the directory?
For example
/etc/a.txt:changed
/etc/b.txt:removed
/etc/c.txt:added
Thanks! (1 Reply)
Discussion started by: overmindxp
1 Replies
4. Shell Programming and Scripting
Hi
I am looking for the correct syntax to find all files in the current directory without listing sub-directoris. I was using the following command, but it still returns subdirectoris and files inside them:
$ ls -laR | grep -v ^./
Any idea? Thanks
PS I am in ksh88 (4 Replies)
Discussion started by: aoussenko
4 Replies
5. Shell Programming and Scripting
Guys,
Here is the script that searches string from the set of similar files from the log directory, All the file patterns are defined as input file, from where the script should map to those files in the LOG_DIR and should start searching the strings from all those similar files.
... (1 Reply)
Discussion started by: raghunsi
1 Replies
6. UNIX for Dummies Questions & Answers
I am very new to unix as well as shell scripting.
I have to write a script for the following requirement. In have to list all the files in directory and its sub directories along with file path and size of the file
Please help me in this regard and many thanks in advance. (3 Replies)
Discussion started by: nmakkena
3 Replies
7. Shell Programming and Scripting
I am trying following ...
ls -ltrh | grep 'Dec 2'
but it is displaying files for last year also ..as this dir is full of files from last 3-5 yrs
I only want to files for today.
e.g .
ls -ltrh | grep 'Dec 2'
-rw-r----- 1 ajay ajay 0 Dec 2 2010 text23.txt
-rw-r----- ... (19 Replies)
Discussion started by: ajaypatil_am
19 Replies
8. Shell Programming and Scripting
Hi all,
I'd very grateful for some help with the following:
I have a directory with several subdirectories with files in them. All files are named different, even between different subdirectories. I also have a list with some of those file names in a txt file (without the path, just the file... (5 Replies)
Discussion started by: foracoffee
5 Replies
9. Shell Programming and Scripting
Need help on below query asap. Thanks.
The below is the directory structure:
/home/suren
under /suren the following are the directories
/bin
/log
/error
/bin contains the following files
abc.txt
bcd.ksh
cde.sh
wer.ksh
ghi (file with out any extension)
/log contains the following... (1 Reply)
Discussion started by: sureng
1 Replies
10. Shell Programming and Scripting
bash or c-shell On Solaris 10
I need a command that will list the files of a directory, and grep each of those filenames out of a static text file, and then only echo field 2 of the static text file.
Something like this:
#> ls -1 /home/dir/ | each filename grep $filename static.txt |awk... (4 Replies)
Discussion started by: ajp7701
4 Replies
DCHECK(8) System Manager's Manual DCHECK(8)
NAME
dcheck - file system directory consistency check
SYNOPSIS
dcheck [ -i numbers ] [ filesystem ]
DESCRIPTION
Dcheck reads the directories in a file system and compares the link-count in each i-node with the number of directory entries by which it
is referenced. If the file system is not specified, a set of default file systems is checked.
The -i flag is followed by a list of i-numbers; when one of those i-numbers turns up in a directory, the number, the i-number of the direc-
tory, and the name of the entry are reported.
The program is fastest if the raw version of the special file is used, since the i-list is read in large chunks.
SEE ALSO
filsys(5), clri(8), fsck(8), icheck(8), ncheck(8)
DIAGNOSTICS
When a file turns up for which the link-count and the number of directory entries disagree, the relevant facts are reported. Allocated
files which have 0 link-count and no entries are also listed. The only dangerous situation occurs when there are more entries than links;
if entries are removed, so the link-count drops to 0, the remaining entries point to thin air. They should be removed. When there are
more links than entries, or there is an allocated file with neither links nor entries, some disk space may be lost but the situation will
not degenerate.
BUGS
Since dcheck is inherently two-pass in nature, extraneous diagnostics may be produced if applied to active file systems. Default file sys-
tems vary with installation so dcheck should use fstab(5).
3rd Berkeley Distribution DCHECK(8)