Sponsored Content
Full Discussion: List year for a Folder
Operating Systems HP-UX List year for a Folder Post 302831501 by vidyadhar85 on Thursday 11th of July 2013 05:12:12 AM
Old 07-11-2013
Behaviour of ls is such that the year is displayed only for files older than 6 months. If you want the year for files less than 6 months old, you will have to write a program either in C/perl/python that does the task.

if you have --time-style in your ls man page you can display year with ls --full-time

perl command..

Code:
 
perl -e '@d=localtime ((stat(shift))[9]); printf "%02d-%02d-%04d %02d:%02d:%02d\n", $d[3],$d[4]+1,$d[5]+1900,$d[2],$d[1],$d[0]' file


Last edited by vidyadhar85; 07-11-2013 at 06:18 AM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Command to list samba shared folder in linux

Hi All, Is there any command to list samba shared folders in red hat linux 7.2 Thanks in advance Bache Gowda (0 Replies)
Discussion started by: bache_gowda
0 Replies

2. Shell Programming and Scripting

trying to list everything in a folder except . and ..

I want to list everything in a directory, including dotfiles (example .file1) except for the . and .. that are in every folder. I'm guessing it's some sort of regular expression I need. So far, I have come up with ls -a | grep That lists the .file1 file only (though I don't see why it should,... (2 Replies)
Discussion started by: dkieran
2 Replies

3. Shell Programming and Scripting

Need year to display from ftped files list

Hi All, p_ftp=dummy time ftp -niv 192.0.0.2 << EOF user dummy dummy cd prt/$p_ftp ascii ls -ltr quit output is -rw-r--r-- 1 500 500 5137 Mar 04 11:21 dummy.csv can any one suggest how to get year while using ftp (1 Reply)
Discussion started by: Vrgurav
1 Replies

4. UNIX for Dummies Questions & Answers

List certain file in a folder and make list

Hi, im having problem that frustate me today. there are list of file in a folder that i want to grab the folder /subject/items/ in this folder there are this file CREATE_SUBxxxx.xml UPDATE_SUBxxxx.xml DELETE_SUBxxxx.xml loginresponsexxxxx.xml core how can i grab all the file... (1 Reply)
Discussion started by: andrisetia
1 Replies

5. UNIX for Dummies Questions & Answers

dtterm to list a folder contents in new window

Hi everyone,:cool: thank you in advance for any help on this I have a dtterm command to open a new small terminal window with a contents of log, and it works fine. dtterm -title "my.log" -geometry =40x30+0+550 -fn 6x13 -e tail -n 40 -f /home/logs/user.log & However what I want to do... (4 Replies)
Discussion started by: golfcents
4 Replies

6. Shell Programming and Scripting

List of files in a folder inclusive subfolder

Hi, I need to list the names of existing files in a specific folder. I have written a script for that, but the problem is, it is also picking up name of a subfolder that is there in that folder. I need only the list of files and not that subfolder. How to go about that ? Can anyone plz help... (2 Replies)
Discussion started by: Subhasis
2 Replies

7. UNIX for Dummies Questions & Answers

Unable to list folder contents

I'm unable to list the contents of a directory once I move into it. I have full permissions on this directory (called "Scripts" in the below example). The scenario is shown below in detail: Command 'ls' works fine to begin with: 1: pmn@linuxhost /home/pmn > cd /opt/smt/proiv 2:... (4 Replies)
Discussion started by: pmn
4 Replies

8. UNIX for Beginners Questions & Answers

How to list todays file in perticular folder?

How to list todays file in perticular folder Moved thread to appropriate forum (9 Replies)
Discussion started by: pspriyanka
9 Replies

9. Shell Programming and Scripting

Find the owner user of each folder in a list

Hello I have a file containing the list of different folders like this file_list.txt: /s8/tests/test1 /s8/tests/tests/test2 /s8/tests/test2 /s8/tests/tests/test2/test5 I want a script to put the owner user of each folder in front of it in the text file. So the reult would become... (5 Replies)
Discussion started by: Johanni
5 Replies
Email::Folder(3pm)					User Contributed Perl Documentation					Email::Folder(3pm)

NAME
Email::Folder - read all the messages from a folder as Email::Simple objects. SYNOPSIS
use Email::Folder; my $folder = Email::Folder->new("some_file"); print join " ", map { $_->header("Subject") } $folder->messages; METHODS
new($folder, %options) Takes the name of a folder, and a hash of options If a 'reader' option is passed in then that is used as the class to read in messages with. messages Returns a list containing all of the messages in the folder. Can only be called once as it drains the iterator. next_message acts as an iterator. reads the next message from a folder. returns false at the end of the folder bless_message($message) Takes a raw RFC822 message and blesses it into a class. By default this is an Email::Simple object but can easily be overriden in a subclass. For example, this simple subclass just returns the raw rfc822 messages, and exposes the speed of the parser. package Email::RawFolder; use base 'Email::Folder'; sub bless_message { $_[1] }; 1; reader read-only accessor to the underlying Email::Reader subclass instance PERL EMAIL PROJECT
This module is maintained by the Perl Email Project <http://emailproject.perl.org/wiki/Email::Folder> AUTHORS
Simon Wistow <simon@thegestalt.org> Richard Clamp <richardc@unixbeard.net> COPYING
Copyright 2006, Simon Wistow Distributed under the same terms as Perl itself. This software is under no warranty and will probably ruin your life, kill your friends, burn your house and bring about the doobie brothers. SEE ALSO
Email::LocalDelivery, Email::FolderType, Email::Simple perl v5.10.0 2009-07-27 Email::Folder(3pm)
All times are GMT -4. The time now is 08:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy