01-24-2011
In POSIX regular expressions, modifiers like * need a character before them to describe what they're modifying. . is a special character meaning 'match any character'. So .* means 'match any number of any character'.
I don't think you should be putting the path inside the expression. I don't think the path is actually part of what gets matched. You can limit what directories it goes inside with mindepth and maxdepth, to limit it to ./ that would be -mindepth 1 -maxdepth 1
If you use -name, you get behavior like you were expecting: find ./ -mindepth 1 -maxdepth 1 -name 'oos*.txt'
-iname acts like -name but is case-insenstive. It may be unavailable depending on your system, though.
This User Gave Thanks to Corona688 For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
problem String
~~~~~~~~~~~~~~~~~~
icecream= { smart peopleLink "good" LC "happy" ,
smartpeopleLink "dull" LC "sad" }
aend = {smart vc4 eatr kalu}
output needed
~~~~~~~~~~~~~~~~~~
smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad"
smart vc4... (4 Replies)
Discussion started by: keshav_rk
4 Replies
2. Shell Programming and Scripting
Dear friends,
please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories..
it is like this,
current directory contains
file1, file2, file3, dir1, dir2
and dir1 conatins
file4, file5
and dir2 contains
file6,... (9 Replies)
Discussion started by: swamymns
9 Replies
3. UNIX for Dummies Questions & Answers
I want to use the find command to search a ton of files, but I want to break it up into multiple machines. I want to search for files with "filename." in the title.
The location I want to search is:
/u/*/*/*/stuff
On the first computer I want to search:
/u//*/*/stuff
Right now I am doing... (1 Reply)
Discussion started by: msf5042
1 Replies
4. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
5. Shell Programming and Scripting
Hello everyone
Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried
sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I'm trying to understand why the find command below is not listing a directory which was modified long back from the number of days specified in the mtime part. :confused:
user-aster :/mydir
$ ls -ld 1607570a-4fed44bb-4988
drwxr-xr-x 3 xyz abc 4096 Jun 29 01:02 1607570a-4fed44bb-4988... (4 Replies)
Discussion started by: aster007
4 Replies
7. Shell Programming and Scripting
I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies
8. Shell Programming and Scripting
I am new to bash/shell scripting.
I want to find all the files in directory and subdirectories, which are not ends with “.zip” and which are contains in the file name “*.log*” or “*.out*”.
I know below command to get the files which ends with “.log”; but I need which are not ends with this... (4 Replies)
Discussion started by: Mallikgm
4 Replies
9. Shell Programming and Scripting
These three finds worked as expected:
$ find . -iname "*.PDF"
$ find . -iname "*.PDF" \( ! -name "*_nobackup.*" \)
$ find . -path "*_nobackup*" -prune -iname "*.PDF"
They all returned the match:
./folder/file.pdf
:b:
This find returned no matches:
$ find . -path "*_nobackup*" -prune... (3 Replies)
Discussion started by: wolfv
3 Replies
10. Shell Programming and Scripting
I've found this script part on the stackoverflow:
if ; then
sudo bash "$0" "$@";
exit "$?";
fi
I realized that sudo bash "$0" "$@"; is the only needed for me.
But the strange thing happens when I move this line outside the IF statement:
sudo bash "$0" "$@"; stops the... (9 Replies)
Discussion started by: boqsc
9 Replies
LEARN ABOUT DEBIAN
logtool
logtool(1) General Commands Manual logtool(1)
NAME
logtool - parse and filter syslog files
SYNOPSIS
(stdout) | logtool -[args]
Logtool is a command line program that will parse logfiles into a more palatable format. It will take anything resembling a syslog or mul-
tilog file, as well as unformatted ASCII, and crunch it into one of the following formats for your viewing pleasure:
ANSI (colorized for easy "at a glance" viewing)
ASCII (e-mail reports/term's w/o color)
CSV (spreadsheet/database imports)
HTML (for generating web pages)
RAW (for no good reason)
OPTIONS
-o [ ANSI | ASCII | CSV | HTML | RAW ]
Allows you to specify the output format to be one of the following: ANSI (default), ASCII, CSV, HTML, RAW. Options are not case sen-
sitive (ie: -o CSV and -o csv should yield the same results)
-t [ long | short ]
Allows you to specify the time display format to be one of the following: (Long [default]) Mon Dy HH:MM:SS or (Short) HH:MM
-b Causes logtool to beep on RED events (ANSI output only). This is usefull when you want to monitor a logfile on an ongoing basis, and
wish to have your terminal beep whenever something out of the ordinary happens.
-s Causes logtool to not display the syslog "source" field
-p Causes logtool to not display the "program" field
-c [/path/config.file]
Allows you to specify a config file other than the default /etc/logtool/logtool.conf
-i [/path/includefile]
Allows you to specify an alterate file containing regex's for inclusion [default=/etc/logtool/include]
-e [/path/excludefile]
Allows you to specify an alternate file containing regex's for exclusion [default=/etc/logtool/exclude]
-n Causes logtool to skip any attempts to resolve IP->Hostname by the various modules (handy when your DNS is down temporairly).
-v Set logtool to operate in verbose mode (does nothing currently)
-V Causes logtool to print it's version information and exit
-h Display the help message
SUGGESTED USAGE(S)
As a 'live' logfile monitoring tool:
tail -f /var/log/messages | logtool -o ANSI -b
To generate colorized webpages of logfiles:
cat /var/log/messages | logtool -o HTML > /home/httpd/html/logs/messages.html
To generate reports via a cronjob:
retail /var/log/messages | logtool -o ASCII | mail -s "Daily report" someuser@somedomain.ext
CONFIG FILE
/etc/logtool/logtool.conf
The config file should be commented to the point of being self-documenting, so we will not comment very extensively on it here. Suffice to
say, this is the place where you should configure 99% of your runtime options for logtool. You may also have a collection of different
default configurations, and select amongst them by the '-c' option of logtool.
AVAILABILITY
Logtool is known to compile/run on all UNIX flavors using a 2.95.x GNU C Compiler, the GNU Make utility, and a proper ANSI C library (glibc
is recommended, but not required). Specific reports of success include FreeBSD, OpenBSD, Solaris, SunOS, AIX, SCO, and of course, any
known flavor of Linux (including at least 2 embedded system variants).
SEE ALSO
regex(7) for help with constructing regular expressions for the include/exclude/colors files. If you find no regex manual on your system,
try 'apropos regex' and see what you get, or as a last ditch, 'man grep' should at least point you in the right direction.
You can also find a somewhat better bit of documentation in the textfile 'logtool.txt' (usually in the /usr/doc/, /usr/share/doc/ or simi-
lar tree on most Linux distributions). If you don't know where to look, you can probably find it by typing 'locate logtool.txt' at the
command line.
AUTHOR
A.L.Lambert <al@xjack.org>
LOCAL logtool(1)