Hi,
I need to extract information from a 4 GB file based on the following conditions:
1) Check for the presence of a set of account numbers
Each account number is present along with other information within
a PAGESTART and PAGEEND.
The file looks like this:
PAGESTART
ACCOUNT NO 123... (6 Replies)
I wanna grep for a pattern logs 1 2 & 3 within a folder containing 100 logs
grep "test" /folder/log1 /folder/log2 /folder/log3
The above command will work fine
but is there any command like
grep "test" /folder/log1, log2, log3 or something similar (4 Replies)
Hi All,
Can i use find command to know given date files? If yes, then please let me know the syntax for the same.
Thanks in advance for your postive responses
Regards,
Bachegowda (3 Replies)
I'm learning UNIX on my mac (BSD), using a manual. I'm trying to figure out the grep command, and am getting something wrong. I've opened one of my files in NeoOffice and am looking for a string, the phrase 'I am writing.' I've been to some sites to get the proper syntax, and from what I can see... (5 Replies)
Hello,
I'm working on unix with grep (GNU grep) 2.5.1. I'm going through some of the newer regex syntax using Regular Expression Reference - Advanced Syntax a guide.
ls -aLl /bin | grep "\(x\)"
Which works, just highlights 'x' where ever, when ever.
I'm trying to to get (?:) to work but... (4 Replies)
Alrighty, I'm trying to get a perl script going to search through a bunch of files for me and compile it to a single location. I am currently having troubles on just getting the grep to work.
Here is what I currently have:
#!/usr/bin/perl
open (LOG, "errors.txt") or die
("Unable to open... (2 Replies)
i'm trying to find out how to find in my directory and subdirectories a certain file. once i find that file, i need to select that folder and copy it the location or output it to a new text file.
i know how to find the file by using
find . -name \*.pl | sort -n
but idk how to select... (9 Replies)
Hi Folks,
I am trying to dig through about 100 directories that have 1 or 2 .jpg images stored in each. I want to copy the .jpg to another file in the root directory. Really my ultimate goal is not to have to dig down into each directory to copy the images individually. I thought I could use a... (2 Replies)
My current code is:
user@ubuntu:~/Desktop$ grep -e "\(packaged by\)\|\(employee\)\|\(file name\)\|\(Total Data (MB) Read\)\|\(Begin Time\)" log.txt
packaged by = Ron Mexico
employee = Michael Vick
file name = Mike_Vick_2011.bat
Total Data (MB) Read: 11.82
Begin Time: 6/13/2011... (8 Replies)
Dear Team
/app/Appln/logs/
echo Session used server are 'grep -i pid|grep -i session | cut -d'.' -f1 | awk '{print $9}' | sort | uniq'
Output -
lxserver01
lxserver02
lxserver03
When I grep session pid in logs server details I can see above distinct server details but I... (6 Replies)
Discussion started by: skp
6 Replies
LEARN ABOUT BSD
find
FIND(1) General Commands Manual FIND(1)NAME
find - find files
SYNOPSIS
find pathname-list expression
find pattern
DESCRIPTION
In the first form above, find recursively descends the directory hierarchy for each pathname in the pathname-list (i.e., one or more path-
names) seeking files that match a boolean expression written in the primaries given below. In the descriptions, the argument n is used as
a decimal integer where +n means more than n, -n means less than n and n means exactly n.
The second form rapidly searches a database for all pathnames which match pattern. Usually the database is recomputed weekly and contains
the pathnames of all files which are publicly accessible. If escaped, normal shell "globbing" characters (`*', `?', `[', and ']') may be
used in pattern, but the matching differs in that no characters (e.g. `/') have to be matched explicitly. As a special case, a simple pat-
tern containing no globbing characters is matched as though it were *pattern*; if any globbing character appears there are no implicit
globbing characters.
-name filename
True if the filename argument matches the current file name. Normal shell argument syntax may be used if escaped (watch out for
`[', `?' and `*').
-perm onum
True if the file permission flags exactly match the octal number onum (see chmod(1)). If onum is prefixed by a minus sign, more
flag bits (017777, see stat(2)) become significant and the flags are compared: (flags&onum)==onum.
-type c True if the type of the file is c, where c is b, c, d, f, l or s for block special file, character special file, directory, plain
file, symbolic link, or socket.
-links n True if the file has n links.
-user uname
True if the file belongs to the user uname (login name or numeric user ID).
-nouser True if the file belongs to a user not in the /etc/passwd database.
-group gname
True if the file belongs to group gname (group name or numeric group ID).
-nogroup True if the file belongs to a group not in the /etc/group database.
-size n True if the file is n blocks long (512 bytes per block).
-inum n True if the file has inode number n.
-atime n True if the file has been accessed in n days.
-mtime n True if the file has been modified in n days.
-exec command
True if the executed command returns a zero value as exit status. The end of the command must be punctuated by an escaped semi-
colon. A command argument `{}' is replaced by the current pathname.
-ok command
Like -exec except that the generated command is written on the standard output, then the standard input is read and the command
executed only upon response y.
-print Always true; causes the current pathname to be printed.
-ls Always true; causes current pathname to be printed together with its associated statistics. These include (respectively) inode
number, size in kilobytes (1024 bytes), protection mode, number of hard links, user, group, size in bytes, and modification time.
If the file is a special file the size field will instead contain the major and minor device numbers. If the file is a symbolic
link the pathname of the linked-to file is printed preceded by ``->''. The format is identical to that of ``ls -gilds'' (note
however that formatting is done internally, without executing the ls program).
-newer file
True if the current file has been modified more recently than the argument file.
-cpio file
Write the current file on the argument file in cpio format.
-xdev Always true; causes find not to traverse down into a file system different from the one on which current argument pathname
resides.
The primaries may be combined using the following operators (in order of decreasing precedence):
1) A parenthesized group of primaries and operators (parentheses are special to the Shell and must be escaped).
2) The negation of a primary (`!' is the unary not operator).
3) Concatenation of primaries (the and operation is implied by the juxtaposition of two primaries).
4) Alternation of primaries (`-o' is the or operator).
EXAMPLES
To find all accessible files whose pathname contains `find':
find find
To typeset all variants of manual pages for `ls':
vtroff -man `find '*man*/ls.?'`
To remove all files named `a.out' or `*.o' that have not been accessed for a week:
find / ( -name a.out -o -name '*.o' ) -atime +7 -exec rm {} ;
FILES
/etc/passwd
/etc/group
/var/db/find.codes coded pathnames database
SEE ALSO sh(1), test(1), fs(5)
Relevant paper in February, 1983 issue of ;login:.
BUGS
The first form's syntax is painful, and the second form's exact semantics is confusing and can vary from site to site.
More than one `-newer' option does not work properly.
7th Edition October 11, 1996 FIND(1)