10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to figure out how many times a location (columns 1 and 2) is present within a group of files. I figured using a combination of 'while read' and 'grep' I could count the number of instances but its not working for me.
cat file.txt | while read line
do
grep $line *08-new.txt | wc -l... (6 Replies)
Discussion started by: ncwxpanther
6 Replies
2. Shell Programming and Scripting
So I have a loop that stated if a directory exists or not. If it does it prints the number of files within that directory. I use this code...
result=`(ls -l . | egrep -c '^-')`
However, no matter which directory I input, it outputs the number "2"
What is wrong here? (4 Replies)
Discussion started by: itech4814
4 Replies
3. Shell Programming and Scripting
Hi all,
Can someone help me in getting the following o/p
I/p:... (7 Replies)
Discussion started by: Sri3001
7 Replies
4. UNIX for Dummies Questions & Answers
Help Needed !
Can we count number of folders of specific date in a directory, even if directory has folders of different dates.
Please reply as soon as possible. (1 Reply)
Discussion started by: vishal_215
1 Replies
5. UNIX for Advanced & Expert Users
Hi all,
Need some help counting files... :)
I'm trying to count the number of files in a given directory (and subdirectories) which reportedly contains "thousands" of files.
I'm using this:
ls -R | wc -l
However it's been an hour and looks like it's still running; there is no output... (18 Replies)
Discussion started by: verdepollo
18 Replies
6. Shell Programming and Scripting
Hi All,
I have written a script on this but it does not do the requisite job. My requirement is this:
1. I have two kinds of files each with different extensions. One set of files are *.dat (6000 unique DAT files all in one directory) and another set *.dic files (6000 unique DIC files in... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies
7. Shell Programming and Scripting
Hello, I'm writing a script in sh in which the first command line argument is a directory. from that, i'm suppose to count the number of readable, writable, and executable items in the directory. I know using $1 represents the directory, and ls would display all the items in the directory, and that... (4 Replies)
Discussion started by: kratos22
4 Replies
8. Shell Programming and Scripting
hi all,
i'm trying to pass a count of files to a variable thru these set of codes:
sh_count=$(ls -1 fnd_upload_LV*.* |wc -l)
problem is if no files matches that, it will give an error "ls: fnd_upload_LV*.*: No such file or directory".
how do i avoid having the shell script show that... (2 Replies)
Discussion started by: adshocker
2 Replies
9. Shell Programming and Scripting
Hi,
I am trying out different scripts in PERL. I want to take a line/string as an input from the user and count the number of occurrances of all the alphabets (a..z) in the string. I tried doingit like this :
#! /opt/exp/bin/perl
print "Enter a string or line : ";
$string = <STDIN>;
chop... (5 Replies)
Discussion started by: rsendhilmani
5 Replies
10. UNIX for Dummies Questions & Answers
Some simple questions from a simple man.
If i wanted to count the number of files contained within a directory, say /tmp would ls -l /tmp ¦ wc -l suffice and will it be accurate?
second one: How would i check the number of files with a certain string in the filename, in the same directory.
... (2 Replies)
Discussion started by: iamalex
2 Replies