awk script to find the number of files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting awk script to find the number of files
# 1  
Old 10-31-2006
awk script to find the number of files

awk script to find the number of files in a directory with their date less than 15-oct-2006

please help
# 2  
Old 10-31-2006
Why you want to use awk only? Any technical reason.?
# 3  
Old 10-31-2006
no technical reason as such.
even a awk command on the prompt line would do
# 4  
Old 10-31-2006
Why you don't you use find, like this:
Code:
#Create a file with a datestamp of 15 Oct, 2006 first
touch -t 200610150000.00 test

#Find the files newer than 'test' and redirect the output to test1 file
find . -type f -newer test -print > test1

#Count the number of lines in 'test1' file, this is what you want
wc -l test1

# 5  
Old 10-31-2006
Ajay,

Have you explored 'find' command with '-ctime' or '-mtime' option?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk or other way to find out number of occurrence of 7th character

Hi all, I am looking for to filter out based on 7th character and list the number of occurrence based on the 7th character if p , d , o or m 1. if 7th character is p , Output should be: p_hosts = N 2. if 7th character is d , Output should be: d_hosts = N 3. if 7th character is o , Output... (10 Replies)
Discussion started by: rveri
10 Replies

2. Shell Programming and Scripting

awk to find number in a field then print the line and the number

Hi I want to use awk to match where field 3 contains a number within string - then print the line and just the number as a new field. The source file is pipe delimited and looks something like 1|net|ABC Letr1|1530||| 1|net|EXP_1040 ABC|1121||| 1|net|EXP_TG1224|1122||| 1|net|R_North|1123|||... (5 Replies)
Discussion started by: Mudshark
5 Replies

3. Shell Programming and Scripting

awk to find the number of occurrence

My file contains like this on 10 th line NM1*IL*1* awk '/NM1/{print NR}' *.dat output is 10 awk '/NM1*IL*1*/{print NR}' *.dat output is Nothing but im expecting 10 on second code as well . (4 Replies)
Discussion started by: Rajesh_us
4 Replies

4. Shell Programming and Scripting

awk - find number in string

I am trying to go through a file that has a few million lines. I want to only pull lines that contain a number anywhere in the ninth field, but it has to be after a "/" character. Here is my awk: awk -F\| '$9 ~ /\/*{1,}*/ {print $0}' file1 > file2 However, it is just printing out every... (3 Replies)
Discussion started by: dagamier
3 Replies

5. Shell Programming and Scripting

Bash script to find the number of files and identify which ones are 0 bytes.

I am writing a bash script to find out all the files in a directory which are empty. I am running into multiple issues. I will really appreciate if someone can please help me. #!/bin/bash DATE=$(date +%m%d%y) TIME=$(date +%H%M) DIR="/home/statsetl/input/civil/test" ... (1 Reply)
Discussion started by: monasharma13
1 Replies

6. Shell Programming and Scripting

Find number in string and delete it AWK

Hi all, i have some logs on my linux server that looks like this: CDR.2012-04-30:30-04-2012 14:09:36;123456456654;A;Greetings! Your amount is 42.24 dollars (without VAT) until 30/04/2012 11:00. CDR.2012-04-30:30-04-2012 14:09:36;12154878454212;A;Greetings! Your amount is 4203.2 dollars... (2 Replies)
Discussion started by: arrals_vl
2 Replies

7. Shell Programming and Scripting

reading number of files..one by one in awk script

Hi I have awk script that is reading data from file and printing the result on the monitor....I need to read more than one file .....one by one... and store the result in output file... ---------- Post updated at 06:41 AM ---------- Previous update was at 06:39 AM ---------- please i need... (4 Replies)
Discussion started by: aldreho
4 Replies

8. Shell Programming and Scripting

How to do a find number of files in awk

Hi, How can i able to do a similar operation to "find" number of files in a folder in an awk? In bash, we could do easily using "find" command. But currently, I am having an awk block and i wanted to extract these information. Please advise. Thanks. (2 Replies)
Discussion started by: ahjiefreak
2 Replies

9. Shell Programming and Scripting

script to find the average number or files?

Anyone has a script or command in UNIX that can take 4 to five different numbers and calculate the average? (2 Replies)
Discussion started by: bbbngowc
2 Replies

10. UNIX for Dummies Questions & Answers

how to find the number of files

hi, 1) I want to find from the current directory the number of files (count) with two or more particular extentions in another directory. For ex: If I am in a/b/c directory... I want to find the count of the files with .txt and .dat extention in a/d/e directory. I have tried using the below... (5 Replies)
Discussion started by: harish409
5 Replies
Login or Register to Ask a Question