10-24-2005
string search in folders with particular multiple file extension
Hi,
I am newbie in UNIX so please excuse for my questions.
Is there a a way to search for string in files within folder and sub folder in particluar file extensions.
Ex. search for ABC in folder 'A'(including it's sub folders) in html, xml files.
Thanks,
Ani
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have a couple of things I got stuck on
1)
I have a text file containing 25k search string that I need to search against compressed file. I have used this command but somehow it doesn't seems to use all the search terms.
I have put one search string per line in the txt file (I clean up... (2 Replies)
Discussion started by: m00
2 Replies
2. Shell Programming and Scripting
Hi,
filenames:
contains name of list of files to search in.
placelist
contains the names of places to be searched in all files in "filenames"
for i in $(<filenames)
do
egrep -f placelist $i
if ]
then
echo $i
fi
done >> outputfile
Output i am getting: (0 Replies)
Discussion started by: pinnacle
0 Replies
3. Shell Programming and Scripting
I tried awk for this, but failed <or my code is not correct? I dont know>. Can anyone help me on this?
---------- Post updated at 08:34 PM ---------- Previous update was at 08:29 PM ----------
my working file looks like this:
<empty>
<empty>
<empty>
NAME :ABC AGE :15
GENDER... (6 Replies)
Discussion started by: kingpeejay
6 Replies
4. Shell Programming and Scripting
hi all,
i'm new to shell scripting, i need help from u guys to do my task now..
i just need to check a file extension existence in a directory, and if it exists then i have to continue my processing.
pls give me the command to check the extension of the files (6 Replies)
Discussion started by: divak
6 Replies
5. Shell Programming and Scripting
Hi,
Need your help for this scripting issue I have. I am not really good at this, so seeking your help.
I have a file looking similar to this:
Hello, i am human and name=ABCD.
How are you?
Hello, i am human and name=PQRS.
I am good.
Hello, i am human and name=ABCD.
Good bye.
Hello, i... (12 Replies)
Discussion started by: royzlife
12 Replies
6. Shell Programming and Scripting
hi ,
i am having a file where i need to take ignore the data from file1.txt and redirect to another file
for eg:
file1.txt
AUS
USA
file2.txt
AUS,123
NZ,11
USA,12
i am using the below code (4 Replies)
Discussion started by: rohit_shinez
4 Replies
7. Shell Programming and Scripting
Hi,
Can someone please help me with a Command to Search a FILE for a STRING in multiple DIRECTORIES.
I am searching for the VIP in HTTPD.CONF in multiple httpd instances.
I am using
find ./ -name "httpd.conf" | xargs grep 10.22.0.141 cut -d: -f3- | cut -d ' ' -f4 | sort | uniq -c
... (1 Reply)
Discussion started by: crosairs
1 Replies
8. Shell Programming and Scripting
I have a directory that is in the below order (the --- is not part of the directory tree, only there to help illustrate:
DATE --- main level
Folder1 --- level under DATE
plugin_out --- level under Folder1
variantCaller_out.40 --- level under plugin_out
001,002,003 --- level under... (3 Replies)
Discussion started by: cmccabe
3 Replies
9. UNIX for Beginners Questions & Answers
Hello,
Opearting System Environment : HP Unix B.11.31 U
I look for script to
On specific folders list
On specific filelist
Search for given string
For Example :
r48_buildlib.txt contains
wpr480.0_20161027
wpr480.0_20161114
wpr481.0_20161208
wpr482.0_20161222... (4 Replies)
Discussion started by: Siva SQL
4 Replies
10. UNIX for Beginners Questions & Answers
Lets say I have a massive directory which is filled with other directories all filled with different c++ scripts and I want a listing of all the scripts that contain the string: "this string". Is there a way to use a grep search for that? I tried:
grep -lr "this string" *
but I do not... (3 Replies)
Discussion started by: Circuits
3 Replies
folders(1) General Commands Manual folders(1)
NAME
folders - list folders and contents (only available within the message handling system, mh)
SYNOPSIS
folders [+folder] [msg] [options]
OPTIONS
Lists only the name of folders, with no additional information. This is faster because the folders need not be read. Prints a list of the
valid options to this command. Lists the contents of the folder-stack. No +folder argument is allowed with this option. Re-numbers mes-
sages in the folders. Messages are re-numbered sequentially, and any gaps in the numbering are removed. The default operation is -nopack,
which does not change the numbering in the folder. Discards the top of the folder-stack, after setting the current folder to that value.
No +folder argument is allowed with this option. This corresponds to the popd operation in the C-shell; see csh(1). The -push and -pop
options are mutually exclusive: the last occurrence of either one overrides any previous occurrence of the other. Pushes the current
folder onto the folder-stack, and makes the +folder argument into the current folder. If +folder is not given, the current folder and the
top of the folder-stack are exchanged. This corresponds to the pushd operation in the C-shell; see csh(1). The -push switch and the -pop
switch are mutually exclusive: the last occurrence of either one overrides any previous occurrence of the other. Lists folders recur-
sively. Information on each folder is displayed, followed by information on any sub-folders which it contains. Displays only the total
number of messages and folders in your Mail directory. This option does not print any information about individual folders. It can be sup-
pressed using the -nototal option.
The defaults for folders are:
+folder defaults to all msg defaults to none -nofast -noheader -nototal -nopack -norecurse
DESCRIPTION
The folders command displays the names of your folders and the number of messages that they each contain.
The folders command displays a list of all the folders in your Mail directory. The folders are sorted alphabetically, each on its own line.
This is illustrated in the following example: Folder # of messages ( range ); cur msg (other files)
V2.3 has 3 messages ( 1- 3).
adrian has 20 messages ( 1- 20); cur= 2.
brian has 16 messages ( 1- 16).
chris has 12 messages ( 1- 12).
copylog has 242 messages ( 1- 242); cur= 225.
inbox+ has 73 messages ( 1- 127); cur= 127.
int has 4 messages ( 1- 4); cur= 2 (others).
jack has 17 messages ( 1- 17); cur= 17.
TOTAL= 387 messages in 8 folders.
The plus sign (+) after inbox indicates that it is the current folder. The information about the int folder includes the term (others).
This indicates that the folder int contains files which are not messages. These files may be either sub-folders, or files that do not
belong under the MH file naming scheme.
The folders command is identical to the effect of using the -all option to the folder command.
If you use folders with the +folder argument, it will display all the subfolders within the named folder. as shown in the following exam-
ple:
% folders +test Folder # of messages ( range ); cur msg (other files) test+ has 18 messages ( 1- 18);
(others). test/testone has 1 message ( 1- 1). test/testtwo has no messages.
TOTAL= 19 messages in 3 folders.
See refile(1) for more details of sub-folders.
RESTRICTIONS
MH does not allow you to have more than 100 folders at any level in your Mail directory.
PROFILE COMPONENTS
Path: To determine your MH directory
Folder-Protect: To set protections when creating a new folder
Folder-Stack: To determine the folder stack
lsproc: Program to list the contents of a folder
FILES
The user profile.
SEE ALSO
csh(1), folder(1), refile(1), mhpath(1)
folders(1)