02-28-2009
print contents of any file within some timeframe
Hi,
Is there anyway to print contents of any file ( say log files that grow automatically) within some timeframe ( comparing with current time), say
print contents of the added in:
1) last 2 hr
2) last 45 min
3) last 3 hrs 47 min
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hello
have a file1
H87I
Y788O
T347U
J23U
and
file2 J23U U887Y I99U T556U
file3 I99O J99T F557J
file4 N99I T666U R55Y
file5 H87I T347U
file6 H77U R556Y E44T
file7 Y788O K98U H8I
May be using script we can use file1 to search for all the files
and have the output
H87I file5... (3 Replies)
Discussion started by: cdfd123
3 Replies
2. Shell Programming and Scripting
Hello,
I have a file which has user information. Each user has 2 variables with the same name like
Email: testuser1
Email: testuser1@test.com
Email: testuser2
Email: testuser2@test.com
My intention is to delete the ones without the '@' symbol. When I run this statement awk '/^Email:/&&!/@/'... (6 Replies)
Discussion started by: rmsagar
6 Replies
3. Shell Programming and Scripting
Hi,
can someone help me.
I have some files and search a content in this files. If i have a hit I will print a output:
filename:content
But are more hits in one file: The output is always filename:content
E.G. Seach about "three"
file1 {one, two, three, four, three}
file2... (5 Replies)
Discussion started by: Timmää
5 Replies
4. Shell Programming and Scripting
AT
----------
0
Elapsed: 00:00:00.02
SO
----------
0
Elapsed: 00:00:00.01
SE
----------
0
Elapsed: 00:00:00.01
CR
---------- (4 Replies)
Discussion started by: sandy1028
4 Replies
5. Shell Programming and Scripting
Hi,
Need help in writing a script to read the contents of this file test
Test
00a
00b
00c
00d
00e
00f
where it need to read each line to give a display such as
form meta from dev 00a , config=Striped; add dev 00b:00f to meta 00a
Can any one help me in writing this script (2 Replies)
Discussion started by: praveen1516
2 Replies
6. UNIX for Dummies Questions & Answers
I have a file called po.txt. Here is the content of the file:
<!DOCTYPE PurchaseOrderMessage (View Source for full doctype...)>
- <PurchaseOrder>
- <Header>
<MessageId>cdb3062b-685b-4cd5-9633-013186750e10</MessageId>
<Timestamp>2011-08-01T13:47:23.536-04:00</Timestamp>
</Header>
-... (4 Replies)
Discussion started by: webbi
4 Replies
7. Shell Programming and Scripting
Hi Friends,
This is the only solution to my task. So, any help is highly appreciated.
I have a file
cat input1.bed
chr1 100 200 abc
chr1 120 300 def
chr1 145 226 ghi
chr2 567 600 unix
Now, I have another file by name
input2.bed (This file is a binary file not readable by the... (7 Replies)
Discussion started by: jacobs.smith
7 Replies
8. Shell Programming and Scripting
The file f1 contains the text "body" (shell prompt is "$"):
$ cat ~/path/f1
body
How to print contents of f1 when the f1 path is in a variable?
Here is my failed attempt:
$ f1="~/path/f1"
$ echo $f1
~/path/f1
$ cat $f1
cat: '~/path/f1': No such file or directory (2 Replies)
Discussion started by: wolfv
2 Replies
9. UNIX for Beginners Questions & Answers
Trying to use sed to insert the contents of a file into the end of each line in another file
file1
This is a line
Here is another line
This is yet another line
Here is a fourth line
file2
TEXT
desired output
This is a line TEXT
Here is another line TEXT
This is yet another... (6 Replies)
Discussion started by: jimmyf
6 Replies
10. UNIX for Beginners Questions & Answers
I need to find a file and print its contents
I am trying but it is not working
find -path /opt/app-root/src/.npm/_logs -type f -name "*.log" -print
Version
$ bash -version
GNU bash, version 4.4.12(1)-release (x86_64-pc-msys) (1 Reply)
Discussion started by: SVRao19056
1 Replies
LSBOM(8) BSD System Manager's Manual LSBOM(8)
NAME
lsbom -- list contents of a bom file
SYNOPSIS
lsbom [-b] [-c] [-d] [-f] [-l] [-m] [-s] [-x] [--arch archVal] [-p parameters] bom ...
lsbom -h | --help
DESCRIPTION
The lsbom command interprets the contents of binary bom (bom(5)) files. For each file in a bom, lsbom prints the file path and/or requested
information.
If no options are given, lsbom will display the output formatted such that each line contains the path of the entry, its mode (octal), and
its UID/GID. There are slight differences in the output for plain files, directories, symbolic links, and device files as follows:
plain files the UID/GID is followed by the file size and a 32-bit CRC checksum of the file's contents.
symbolic links the UID/GID is followed by the size and checksum of the link path, and the link path itself.
device files the UID/GID file number is followed by the device number.
The -p option can be used to specify a user-defined format for lsbom's output. The format string consists of one or more characters described
below where each character represents a data type. Data types will be separated by tab characters, and each line will end with a newline
character. One can use this mechanism to create output similar to the ls(1) command.
The options are:
-h print full usage
-b list block devices
-c list character devices
-d list directories
-f list files
-l list symbolic links
-m print modified times (for plain files only)
-s print only the path of each file
-x suppress modes for directories and symlinks
--arch archVal when displaying plain files that represent Universal Mach-O binaries, print the size and checksum of the file contents for
the specified archVal (either "ppc", "ppc64", or "i386")
-p parameters print only some of the results Note: each option can only be used once:
c 32-bit checksum
f file name
F file name with quotes (i.e. "/mach_kernel")
g group id
G group name
m file mode (permissions)
M symbolic file mode (i.e. "dr-xr-xr-x" )
s file size
S formatted size
t mod time
T formatted mod time
u user id
U user name
/ user id/group id
? user name/group name
EXAMPLES
lsbom bomfile list the contents of bomfile
lsbom -s bomfile list only the paths of the contents of the bomfile
lsbom -f -l bomfile list the plain files and symbolic links of the bomfiles (but not directories or devices)
lsbom -p MUGsf bomfiles
list the contents of bomfile displaying only the files' modes, user name, group name, size, and filename
SEE ALSO
bom(5), ditto(8), mkbom(8), pkgutil(1)
HISTORY
The lsbom command appeared in NeXTSTEP as a tool to browse the contents of bom files used during installation.
The -p flag appeared in Mac OS X 10.1 in an attempt to make lsbom's output more convenient for human beings.
Mac OS X May 7, 2008 Mac OS X