How to get this out put ?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How to get this out put ?
# 1  
Old 11-25-2011
How to get this out put ?

How to get to know, where are the current logs been updated in the system

or most recently updated logs in the system.


consider /usr/abc/def


and inside the def folder , i have many subfolders


The command out put ,need to give me the log files and there location , which are currently being updated ?


Regards

---------- Post updated at 09:23 PM ---------- Previous update was at 09:22 PM ----------

Please provide the command on AIX ,HP UX and Sun Solaris

Thanks in advance

Regards

---------- Post updated 2011-11-25 at 07:01 PM ---------- Previous update was 2011-11-24 at 09:23 PM ----------

Please help me in getting the above output , it might be a simple question to

OS Experts, But for me it means a lot , so expecting reply For this

Thanks in advance
Regards
# 2  
Old 11-25-2011
There are many possible ways to interpret your request, butI believe that find will do what you need. For instance, to find the files that have been modified in the past twenty-four hours:
Code:
find /usr/abc/def -type f -mtime 0 -print

If the logfiles end in "log" or somesuch, you can further restrict the list of returned files with:
Code:
find /usr/abc/def -type f -name '*log' -mtime 0 -print

Please review the manual page for find, as there are some variations between the operating systems.
# 3  
Old 11-26-2011
Computer

Please help me in getting the above output , it might be a simple command syntax for

OS Experts, But for me it means a lot , so expecting reply For this

Thanks in advance
Regards

---------- Post updated at 07:14 PM ---------- Previous update was at 07:04 PM ----------

Thanks Mr .ludwig, For the Response,

could you help on this .


1. I need to find for the logs which are being updated currently in the system,


2. In your command syntax , can we extract the logs which are updated in the system

from 6 hours past to present time

and

5 days past to present time.

and

All Logs which are created 2 days back

Thanks in advance Smilie

---------- Post updated 2011-11-26 at 01:10 PM ---------- Previous update was 2011-11-25 at 07:14 PM ----------

Hi All,

Need your reply on this ,


Thanks in advance

Regards
# 4  
Old 11-26-2011
Everyone at the UNIX and Linux Forums gives their best effort to reply to all questions in a timely manner. Demanding a fast reply are not permitted in the regular forums.

For members who want a higher visibility to their questions, we suggest you post in the Emergency UNIX and Linux Support Forum. This forum is given a higher priority than our regular forums.

Posting a new question in the Emergency UNIX and Linux Support Forum requires forum Bits. We monitor this forum to help people with emergencies, but we do not not guarantee response time or best answers. However, we will treat your post with a higher priority and give our best efforts to help you.


Thank you.

The UNIX and Linux Forums
# 5  
Old 11-26-2011
To expect a faster reply, it would be wise to show you are willing to solve your problem and not just rely on others to do the job for you...
What have you done so far?
What can't you do?
Forget a simple command to answer you request...IMHO a command of the sort does not exist in standard...
There are many logs, some may exist or not depending of the system configuration...
So be more precise in your demand and show what you have done so far
# 6  
Old 11-26-2011
Power

Hi vbe/Moderator


Thanks For the Response



First of all ,am not demanding faster response for my question.

After waiting for almost 24 hours, again requested response to my query.

I do fully agree with your thoughts and forum etiquette's.

and am not totally relying on the answers from the peers, also please note that, am an application guy not OS.

So am only anticipating responses from OS experts or peers, not demanding.


To be precise on my requirement

am looking for a command syntax,

To Find

1)location of the files (say *.log) , which are being currently updated in the system

say 5minutes earlier


Thanks and Regards
# 7  
Old 11-29-2011
Sidhartmellam,

Have you taken the time to look at the find manual pages? The -mtime option allows you to specify the number of days, for instance -mtime -5 will find files modified in the past five days. Finding files that have been modified an arbitrary time in the past is also easy with find, using the -newer option, it is just a bit more difficult to create a file with a modification time that is six hours old. If I were do this as a one shot, I'd:
Code:
$ MARK=$(mktemp)
$ ls -l $MARK
-rw-------. 1 ludwig staff 0 Nov 29 08:09 /tmp/tmp.KTAVlOVIKr

Now set the modification time to six hours ago:
Code:
$ touch --date='2011-11-29 02:09:00' $MARK
$ ls -l $MARK
-rw-------. 1 ludwig staff 0 Nov 29 02:09 /tmp/tmp.KTAVlOVIKr

And now find the files:
Code:
$ find /usr/abc/def -type f -name '*log' -newer $MARK -print

There are many ways to script this. A semi-portable method would be to:
Code:
#! /bin/ksh

MARK=$(mktemp)
trap "rm -f ${MARK}" EXIT

case "$(date +%Z)" in
    EST)     tz=GMT+11 ;;
    CST|EDT) tz=GMT+12 ;;
    MST|CDT) tz=GMT+13 ;;
    PST|MDT) tz=GMT+14 ;;
    PDT)     tz=GMT+15 ;;
esac

touch --date="$(TZ=$tz date '+%Y-%m-%d %H:%M:%S')" $MARK
find /usr/abc/def -type f -name '*log' -newer $MARK -print

This works in the continental United-States, YMMV.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SFTP PUT

Hi, ServerA (SFTP server) ServerB (SFTP client) ServerB:> sftp user@ServerA ServerB:> put sample.txt ServerB:> get sample2.txt My question is that which machine will encrypt the sample.txt and sample2.txt files. Thanks (8 Replies)
Discussion started by: Arpit Narula
8 Replies

2. Shell Programming and Scripting

Need to put semicolon

Hi guys, I want to write script so that i can put semicolon after every numeric e.g input would be like that 50060E80058F49A4 Output should be 50:06:0E:80:05:8F:49:A4 Please help Thanks & Regards Nirjhar (11 Replies)
Discussion started by: nirjhar17
11 Replies

3. Solaris

How to sort df -h out put :

Hello every one , I am just trying to sort df -h out in a particular order to differentiate SAN disks and local disks .. does any body have any script or any useful command ?? thanks in advance .. (8 Replies)
Discussion started by: new2uniks
8 Replies

4. UNIX for Dummies Questions & Answers

put $,.

original content: 0000000000 TIAA-CREF 0000000000 CAREMARK all said and done, i'd like to look like this: $00,000,000.00 TIAA-CREF $00,000,000.00 CAREMARK (2 Replies)
Discussion started by: tjmannonline
2 Replies

5. Shell Programming and Scripting

how to put it in a column

Simple question ..What is the easiest way to list my output in a column like so dddd dddd dddd dddd output dddd dddd dddd dddd Thanks (3 Replies)
Discussion started by: bombcan
3 Replies

6. Shell Programming and Scripting

how to put those in Dbase

Hi Experts, I have a file which contains- .. .. <?xml version='1.0' encoding='ISO-8859-1' standalone='no'?> <LogItems> <log logid="83efeae5190809080000080410"> <category>Upstream.TEL</category> <operation>MAKE</operation> <target>mms</target> <user>purple</user>... (3 Replies)
Discussion started by: thepurple
3 Replies

7. Shell Programming and Scripting

How to put the default value

Hi guys Iam looking for a small help.I wrote a script. in that iam trying to take the default value ,when we press enter.this part iam struggling can somebody help please Example: do u need this server: For this one if we press enter it has to take server name as... (4 Replies)
Discussion started by: coolkid
4 Replies

8. UNIX for Dummies Questions & Answers

Where should I put the script?

Hi Guys, I'm a new to the UNIX. Let say I have a 1 simple script to stop and start vnc service. I want to use that script for support because my network connection to my client side is not stable and every time I have to use a long command to restart vnc. Where should I put that script?... (3 Replies)
Discussion started by: akuslive
3 Replies

9. Shell Programming and Scripting

how to put a # in a file

Hello, Sir's, I would like to ask for help. This is my problem, i am working for a mbs for aix,hp-ux and solaris. And i am making a script that will automatically implement the said mbs. For example it will automatically change the permmisions of /usr/bin, /etc/passwd and so on. . . .... (7 Replies)
Discussion started by: invinzin21
7 Replies

10. UNIX for Dummies Questions & Answers

help need help on wine how to put in

how the hell do you put wine in because i don't know i have mandrake please tell how to put in (1 Reply)
Discussion started by: amicrawler
1 Replies
Login or Register to Ask a Question