Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Count the number of files to delete doesnt match Post 302986083 by alexcol on Saturday 19th of November 2016 06:41:08 PM
Old 11-19-2016
Count the number of files to delete doesnt match

Good evening, need your help please

Need to delete certain files before octobre 1 2016, so need to know how many files im going to delete, for instance

Code:
ls -lrt file_20160*.lis!wc -l

but using grep -c to another file called bplist which contains the list of all files backed up doesn match the count

Code:
grep -c file_20160 bplist.txt

the first query gives me 568 files and the second query returns 1120 records-

So before deleting ive got to make sure ive got the right amount of files to delete, so waht am i doing wrong.

After matching the amount of files to delete i need to add a new file

1 using grep to bplist.txt to clasify files to delete this way:


Code:
for file in $(ls -lrt file_20160*.lis!awk '{print $9}')
do
grep $file bplist.txt >>filetodelete.txt
done

is any better and faster way to do that ?


Id appreciate your help in adavnced

Last edited by Don Cragun; 11-19-2016 at 11:01 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep, count and match two files

I am writing the below script to do a grep and count number of occurances between two tab delimited files. I am trying to achieve.. 1) Extract column 2 and column 3 from the S.txt file. Put it in a temp pattern file 2) Grep and count column 2 in D.txt file 3) Compare the counts between... (19 Replies)
Discussion started by: madhunk
19 Replies

2. UNIX for Dummies Questions & Answers

compare two files if doesnt match then display error message

hi , i have one file ,i need to search particular word from this file and if content is matched then echo MATCHED else NOT MATCHED file contains : mr x planned to score 75% in exam but end up with 74%. word to be searched id 75% please help me out . waiting for reply thanks in advance (2 Replies)
Discussion started by: atl@mav
2 Replies

3. Shell Programming and Scripting

Awk Array doesnt match for substring

Awk Array doesnt match for substring nawk -F"," 'FNR==NR{a=$2 OFS $3;next} a{print $1,$2,a}' OFS="," file1 file2 I want cluster3 in file1 to match with cluster3int in file2 output getting: Output required: Help is appreciated (8 Replies)
Discussion started by: pinnacle
8 Replies

4. UNIX for Dummies Questions & Answers

Comparing two files and count number of lines that match

Hello all, I always found help for my problems using the search option, but this time my request is too specific. I have two files that I want to compare. File1 is the index and File2 contains the data: File1: chr1 protein_coding exon 500 600 . + . gene_id "20532";... (0 Replies)
Discussion started by: DerSeb
0 Replies

5. Shell Programming and Scripting

Match and count the number of times

ile1 Beckham Ronaldo file2 Beckham Beckham_human Ronaldo Ronaldo_spain Ronaldo Ronaldo_brazil Beckham Beckham_manch Zidane Zidane_Fran Rooney Rooney_Eng Output shud be (1 Reply)
Discussion started by: cdfd123
1 Replies

6. UNIX for Dummies Questions & Answers

Count number of files in directory excluding existing files

Hi, Please let me know how to find out number of files in a directory excluding existing files..The existing file format will be unknown..each time.. Thanks (3 Replies)
Discussion started by: ammu
3 Replies

7. Shell Programming and Scripting

Count the delimeter from a file and delete the row if delimeter count doesnt match.

I have a file containing about 5 million rows, in the file there are some records which has extra delimiter at random position. (we dont know the positions), now we have to Count the delimeter from each row and if the count of delimeter is not matching then I want to delete those rows from the... (5 Replies)
Discussion started by: Akumar1
5 Replies

8. Shell Programming and Scripting

Count number of match words

Input: some random text SELECT TABLE1 some more random text some random text SELECT TABLE2 some more random text some random text SELECT TABLE3 some more random text some random text SELECT TABLE1 some more random text Output: 'SELECT TABLE1' 2 'SELECT TABLE2' 1 'SELECT TABLE3' 1 I... (5 Replies)
Discussion started by: chitech
5 Replies

9. Shell Programming and Scripting

How to count number of files in directory and write to new file with number of files and their name?

Hi! I just want to count number of files in a directory, and write to new text file, with number of files and their name output should look like this,, assume that below one is a new file created by script Number of files in directory = 25 1. a.txt 2. abc.txt 3. asd.dat... (20 Replies)
Discussion started by: Akshay Hegde
20 Replies

10. Shell Programming and Scripting

Count the pipes "|" in line and delete line if count greter then number.

Hello, I have been working on Awk/sed one liner which counts the number of occurrences of '|' in pipe separated lines of file and delete the line from files if count exceeds "17". i.e need to get records having exact 17 pipe separated fields(no more or less) currently i have below : awk... (1 Reply)
Discussion started by: ketanraut
1 Replies
asadmin-delete-acl(1AS) 					   User Commands					   asadmin-delete-acl(1AS)

NAME
delete-acl - removes the access control list file SYNOPSIS
delete-acl --user admin_user[--password admin_password][--host localhost] [--port 4848][--passwordfile filename][--secure|-s][--instance instance_name] acl_ID Gets the access control lists associated with the named server instance.. OPTIONS
--user administrative user associated for the instance. --password administrative password corresponding to the administrative user. --host host name of the machine hosting the administrative instance. --port administrative port number associated with the administrative host. --secure indicates communication with the administrative instance in secured mode. --passwordfile file containing passwords appropriate for the command (e.g., administrative instance). --instance name of the instance. OPERANDS
acl_ID internal name for the ACL file listing. This ID is used in a virtual server element to define the ACL file used by the virtual server. Example 1: Using delete-acl asadmin> delete-acl --user admin --password adminadmin --host fuyako --port 7070 --instance server1 sampleACL Deleted ACL with id = sampleACL Where: sampleACL is the ACL that is deleted. EXIT STATUS
0 command executed successfully 1 error in executing the command INTERFACE EQUIVALENT
Access Control List page asadmin-create-acl(1AS), asadmin-list-acl(1AS) J2EE 1.4 SDK March 2004 asadmin-delete-acl(1AS)
All times are GMT -4. The time now is 07:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy