03-05-2004
improve performance by using ls better than find
Hi ,
i'm searching for files over many Aix servers with rsh command using this request :
find /dir1 -name '*.[nN][sS][fF]' -exec ls {} \;
and then count them with "wc"
but i would improve this search because it's too long and replace directly find with ls command but "ls *.[nN][sS][fF] " doesn't work.
and the search must be recursive in sub-directories !
anybody has an idea ? i'm searching too..........
Thanks in advance
Christian
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
We have an egrep search in a while loop.
egrep -w "$key" ${PICKUP_DIR}/new_update >> ${PICKUP_DIR}/update_record_new
${PICKUP_DIR}/new_update is 210 MB file
In each iteration, the egrep on an average takes around 50-60 seconds to search. Ther'es nothing significant in the loop other... (7 Replies)
Discussion started by: hidnana
7 Replies
2. Shell Programming and Scripting
Hi All,
I am using grep command to find string "abc" in one file .
content of file is
***********
abc = xyz
def= lmn
************
i have given the below mentioned command to redirect the output to tmp file
grep abc file | sort -u | awk '{print #3}' > out_file
Then i am searching... (2 Replies)
Discussion started by: pooga17
2 Replies
3. UNIX for Dummies Questions & Answers
hi someone tell me which ways i can improve disk I/O and system process performance.kindly refer some commands so i can do it on my test machine.thanks, Mazhar (2 Replies)
Discussion started by: mazhar99
2 Replies
4. Shell Programming and Scripting
I have a data file of 2 gig
I need to do all these, but its taking hours, any where i can improve performance, thanks a lot
#!/usr/bin/ksh
echo TIMESTAMP="$(date +'_%y-%m-%d.%H-%M-%S')"
function showHelp {
cat << EOF >&2
syntax extreme.sh FILENAME
Specify filename to parse
EOF... (3 Replies)
Discussion started by: sirababu
3 Replies
5. Shell Programming and Scripting
Hi Friends,
I wrote the below shell script to generate a report on alert messages recieved on a day. But i for processing around 4500 lines (alerts) the script is taking aorund 30 minutes to process.
Please help me to make it faster and improve the performace of the script. i would be very... (10 Replies)
Discussion started by: apsprabhu
10 Replies
6. Shell Programming and Scripting
Hi All,
I have written a script as follows which is taking lot of time in executing/searching only 3500 records taken as input from one file in log file of 12 GB Approximately.
Working of script is read the csv file as an input having 2 arguments which are transaction_id,mobile_number and search... (6 Replies)
Discussion started by: poweroflinux
6 Replies
7. Shell Programming and Scripting
Hi,
I have around one lakh records. I have used XML for the creation of the data.
I have used these 2 Perl modules.
use XML::DOM;
use XML::LibXML;
The data will loo like this and most it is textual entries.
<eid>19000</eid>
<einfo>This is the ..........</einfo>
......... (3 Replies)
Discussion started by: vanitham
3 Replies
8. Programming
Input file:
#content_1
12314345345
242467
#content_14
436677645
576577657
#content_100
3425546
56
#content_12
243254546
1232454
.
.
Reference file:
content_100 (1 Reply)
Discussion started by: cpp_beginner
1 Replies
9. UNIX for Dummies Questions & Answers
Hi ,
i wrote a script to convert dates to the formate i want .it works fine but the conversion is tkaing lot of time . Can some one help me tweek this script
#!/bin/bash
file=$1
ofile=$2
cp $file $ofile
mydates=$(grep -Po '+/+/+' $ofile) # gets 8/1/13
mydates=$(echo "$mydates" | sort |... (5 Replies)
Discussion started by: vikatakavi
5 Replies
10. Programming
Hello,
Attached is my very simple C++ code to remove any substrings (DNA sequence) of each other, i.e. any redundant sequence is removed to get unique sequences. Similar to sort | uniq command except there is reverse-complementary for DNA sequence. The program runs well with small dataset, but... (11 Replies)
Discussion started by: yifangt
11 Replies
LEARN ABOUT SUNOS
ttysrch
ttysrch(4) File Formats ttysrch(4)
NAME
ttysrch - directory search list for ttyname
DESCRIPTION
ttysrch is an optional file that is used by the ttyname library routine. This file contains the names of directories in /dev that contain
terminal and terminal-related device files. The purpose of this file is to improve the performance of ttyname by indicating which subdirec-
tories in /dev contain terminal-related device files and should be searched first. These subdirectory names must appear on separate lines
and must begin with /dev. Those path names that do not begin with /dev will be ignored and a warning will be sent to the console. Blank
lines (lines containing only white space) and lines beginning with the comment character "#" will be ignored. For each file listed (except
for the special entry /dev), ttyname will recursively search through subdirectories looking for a match. If /dev appears in the ttysrch
file, the /dev directory itself will be searched but there will not be a recursive search through its subdirectories.
When ttyname searches through the device files, it tries to find a file whose major/minor device number, file system identifier, and inode
number match that of the file descriptor it was given as an argument. If a match is not found, it will settle for a match of just
major/minor device and file system identifier, if one can be found. However, if the file descriptor is associated with a cloned device,
this algorithm does not work efficiently because the inode number of the device file associated with a clonable device will never match
the inode number of the file descriptor that was returned by the open of that clonable device. To help with these situations, entries can
be put into the /etc/ttysrch file to improve performance when cloned devices are used as terminals on a system (for example, for remote
login). However, this is only useful if the minor devices related to a cloned device are put into a subdirectory. (It is important to note
that device files need not exist for cloned devices and if that is the case, ttyname will eventually fail.) An optional second field is
used in the /etc/ttysrch file to indicate the matching criteria. This field is separated by white space (any combination of blanks or
tabs). The letter M means major/minor device number, F means file system identifier, and I means inode number. If this field is not speci-
fied for an entry, the default is MFI which means try to match on all three. For cloned devices the field should be MF, which indicates
that it is not necessary to match on the inode number.
Without the /etc/ttysrch file, ttyname will search the /dev directory by first looking in the directories /dev/term, /dev/pts, and /dev/xt.
If a system has terminal devices installed in directories other than these, it may help performance if the ttysrch file is created and con-
tains that list of directories.
EXAMPLES
Example 1: A sample display of /etc/ttysrch command.
A sample /etc/ttysrch file follows:
/dev/term MFI
/dev/pts MFI
/dev/xt MFI
/dev/slan MF
This file tells ttyname that it should first search through those directories listed and that when searching through the /dev/slan direc-
tory, if a file is encountered whose major/minor devices and file system identifier match that of the file descriptor argument to ttyname,
this device name should be considered a match.
FILES
/etc/ttysrch
SEE ALSO
ttyname(3C)
SunOS 5.10 23 Feb 1994 ttysrch(4)