The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Format output using awk in script. bperl Shell Programming and Scripting 8 01-14-2008 01:09 AM
[need help] output format from awk bucci Shell Programming and Scripting 6 02-09-2007 04:41 AM
Output in a particular format using AWK Raynon Shell Programming and Scripting 4 01-24-2007 04:07 AM
format output Tornado Shell Programming and Scripting 7 11-19-2006 06:17 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-14-2001
tonyt tonyt is offline
Registered User
  
 

Join Date: Nov 2001
Location: China
Posts: 18
ls output format

below is the output is ls -l

-rw-r--r-- 1 tonyt staff 3212 Apr 17 1999 file1
-rw-r--r-- 1 tonyt staff 4541 Mar 3 21:08 file2

why the date format is not the same?
  #2 (permalink)  
Old 11-14-2001
LivinFree's Avatar
LivinFree LivinFree is offline Forum Advisor  
Goober Extraordinaire
  
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Quote:
-rw-r--r-- 1 tonyt staff 3212 Apr 17 1999 file1
-rw-r--r-- 1 tonyt staff 4541 Mar 3 21:08 file2
Since file1 was last modified in a year different than the current one, it will show you the year, instead of the time.
  #3 (permalink)  
Old 11-14-2001
tonyt tonyt is offline
Registered User
  
 

Join Date: Nov 2001
Location: China
Posts: 18
Then how can I change the mtime of a file? which command should I use?
  #4 (permalink)  
Old 11-14-2001
doeboy's Avatar
doeboy doeboy is offline
Registered User
  
 

Join Date: Oct 2001
Location: Here
Posts: 137
Use the "touch" command.

You can use it to set the file timestamp to a time that you specify.

See touch(1) man pages for more information.
  #5 (permalink)  
Old 11-23-2001
tonyt tonyt is offline
Registered User
  
 

Join Date: Nov 2001
Location: China
Posts: 18
Quote:
Originally posted by LivinFree


Since file1 was last modified in a year different than the current one, it will show you the year, instead of the time.
I've found another file:
-rwxr-xr-x 1 root wheel 3824 Apr 27 2001 env
So the year is current year. Why it show up the year instead of date?thx
  #6 (permalink)  
Old 11-23-2001
Jimbo
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
On HP-UX, end of calendar year is not the cutoff. Datestamps older than approx 180 days are displayed with the year instead of the time. To demo this:

touch -t200105201200 myfile1
touch -t200105251200 myfile2
touch -t200105301200 myfile3
touch -t200106051200 myfile4

ls -l myfile*
  #7 (permalink)  
Old 11-23-2001
tonyt tonyt is offline
Registered User
  
 

Join Date: Nov 2001
Location: China
Posts: 18
Cute! It works. Thanks for your help.
Sponsored Links
Closed Thread

Bookmarks

Tags
mtime

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:27 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0