How to get timestamp of a file in HPUX


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to get timestamp of a file in HPUX
# 1  
Old 03-05-2011
How to get timestamp of a file in HPUX

Hi All,

Am trying to get a command which gives the "date + time" that a file was edited.

I cant use "ls -l" because it fails to get me the "time stamp" of files that were edited more than 6 months ago...commands like "stat" "ctime" etc aren't available on my server and I can't install them either due to lack of admin rights...

Somebody please help!
# 2  
Old 03-05-2011
Code:
du -a --time

# 3  
Old 03-05-2011
Quote:
Originally Posted by yinyuemi
Code:
du -a --time

Thanks for the quick reply Yinyuemi.

However, I get the following error while trying to use this command --
>du -t --time XYZ.gnt
du: invalid file system type --time

Am I missing something?
# 4  
Old 03-05-2011
try:
Code:
du --time yourfile
 
 
du -a --time ## can list all the files and dirs

# 5  
Old 03-05-2011
Quote:
Originally Posted by yinyuemi
try:
Code:
du --time yourfile
 
 
du -a --time ## can list all the files and dirs

Nope...still didnt work...getting this error now..

>du -a --time
du: illegal option -- -
usage: du [-a|-s] [-kbrx] [-H|-L] [-t type] [name ...]


i think ive tried all the different variants..checked the man page of du...which has no mention about time-stamp etc

Is there any other way?
# 6  
Old 03-05-2011
For the benefit of those who have been posting Linux or GNU versions of commands and add-ons, HP-UX is a fairly normal unix. Mentioning the exact version of HP-UX always helps.

When a file is more than 6-months old it is not possible to display the "updated" timestamp in HP-UX (or umpteen standard unix variants) with a basic "ls" command.

The exact timestamp is still there in the inode. If you need the value it is available through a custom "C" program or downloadable add-ons (I have read you post).

Reading between the lines please bear in mind that the unix "find" command is very powerful when looking for files of a given age. Processing the output from "ls" is hard work.

Bottom line: What are you trying to do? What did you try? What went wrong?

Last edited by methyl; 03-05-2011 at 06:28 AM.. Reason: typos
This User Gave Thanks to methyl For This Post:
# 7  
Old 03-05-2011
These 2 Users Gave Thanks to Perderabo For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep lines between last hour timestamp and current timestamp

So basically I have a log file and each line in this log file starts with a timestamp: MON DD HH:MM:SS SEP 15 07:30:01 I need to grep all the lines between last hour timestamp and current timestamp. Then these lines will be moved to a tmp file from which I will grep for particular strings. ... (1 Reply)
Discussion started by: nms
1 Replies

2. Shell Programming and Scripting

Picking the latest file based on a timestamp for a Dynamic file name

Hi , I did the initial search but could not find what I was expecting for. 15606Always_9999999997_20160418.xml 15606Always_9999999998_20160418.xml 15606Always_9999999999_20160418.xml 9819Always_99999999900_20160418.xml 9819Always_99999999911_20160418.xmlAbove is the list of files I... (4 Replies)
Discussion started by: chillblue
4 Replies

3. Shell Programming and Scripting

AIX : Need to convert UNIX Timestamp to normal timestamp

Hello , I am working on AIX. I have to convert Unix timestamp to normal timestamp. Below is the file. The Unix timestamp will always be preceded by EFFECTIVE_TIME as first field as shown and there could be multiple EFFECTIVE_TIME in the file : 3.txt Contents of... (6 Replies)
Discussion started by: rahul2662
6 Replies

4. Shell Programming and Scripting

To check timestamp in logfile and display lines upto 3 hours before current timestamp

Hi Friends, I have the following logfile. Currently time in india is 07/31/2014 12:33:34 and i have the following content in logfile. I want to display only those entries which contain string 'Exception' within last 3 hours. In this case, it would be the last line only I can get the... (12 Replies)
Discussion started by: srkmish
12 Replies

5. Shell Programming and Scripting

Identifying files with a timestamp greater than a given timestamp

I need to be able to identify files with file timestamps greater than a given timestamp. I am using the following solution, although it appears to compare files at the "seconds" granularity and I need it at the milliseconds. When I tested my solution, it missed files that had timestamps... (3 Replies)
Discussion started by: nkm0brm
3 Replies

6. UNIX for Dummies Questions & Answers

How to compare a file by its timestamp and store in a different location whenever timestamp changes?

Hi All, I am new to unix programming. I am trying for a requirement and the requirement goes like this..... I have a test folder. Which tracks log files. After certain time, the log file is getting overwritten by another file (randomly as the time interval is not periodic). I need to preserve... (2 Replies)
Discussion started by: mailsara
2 Replies

7. Shell Programming and Scripting

Getting a relative timestamp from timestamp stored in a file

Hi, I've a file in the following format 1999-APR-8 17:31:06 1500 3 45 1999-APR-8 17:31:15 1500 3 45 1999-APR-8 17:31:25 1500 3 45 1999-APR-8 17:31:30 1500 3 45 1999-APR-8 17:31:55 1500 3 45 1999-APR-8 17:32:06 1500 3 ... (1 Reply)
Discussion started by: vaibhavkorde
1 Replies

8. HP-UX

pwage-hpux-T for Trusted HPUX servers

I'm sharing this in case anybody needs it. Modified from the original solaris pwage script. This modified hpux script will check /etc/password file on hpux trusted systems search /tcb and grep the required u_succhg field. Calculate days to expiry and notify users via email. original solaris... (2 Replies)
Discussion started by: sparcguy
2 Replies

9. UNIX for Dummies Questions & Answers

I/O performance in HPUX file systems

Hi guys, what is the relation between I/O performance and file systems. I have a file systems called /dcs/data01 which is having 4Tb size. According our application we can split the file system like dcs/data01 -> 1Tb dcs/data02 -> 1Tb dcs/data03 -> 1Tb dcs/data04 -> 1Tb do you... (4 Replies)
Discussion started by: Davinzy
4 Replies

10. Shell Programming and Scripting

Need Script to Use CPUs on a HPUX server to simulate Workload Manager on HPUX.

I am running HPUX and using WLM (workload manager). I want to write a script to fork CPUs to basically take CPUs from other servers to show that the communication is working and CPU licensing is working. Basically, I want to build a script that will use up CPU on a server. Any ideas? (2 Replies)
Discussion started by: cpolikowsky
2 Replies
Login or Register to Ask a Question