Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How do you get the last modification date of a file? Post 302764019 by itkamaraj on Wednesday 30th of January 2013 10:29:03 PM
Old 01-30-2013
you can get the last modification time from your ls command output.

Code:
 
ls -l $1 | awk -v y=`date +%Y` 'BEGIN{a="  JanFebMarAprMayJunJulAugSepOctNovDec"}{if($8~/:/){$8=y}print $8"-"index(a,$6)/3"-"$7}'

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

command for modification date of a file

Good morning, I would like to find all files of a certain type and display their name as well as their modification date. In order to do this, I would do the following: find ./ -name *.csv | ???????? My question: what to put after the pipe instead of the question marks? Is there a basic... (5 Replies)
Discussion started by: scampsd
5 Replies

2. UNIX for Dummies Questions & Answers

Search by modification date

Hi I'd like to know if is it possible to find files given a certain modification date (say, 01-05-2006, that's 1st of May 2006) I can calculate the days backward: find / -ctime 23 but I wish to search by exact modification day Thanks (5 Replies)
Discussion started by: slink
5 Replies

3. UNIX for Dummies Questions & Answers

Shell script: last modification date for a file

Hi i have a ques in Shell scripting: ques: accept a filename as a command line argument. Validate the input and display the last modification date for that file. Help pls. (4 Replies)
Discussion started by: onlyc
4 Replies

4. Shell Programming and Scripting

List the file or files with last modification date

hi. I need help my programing friends :p I need to list all the files with a certain name (for example FileName) by last modification date but only the one with the last date. If there are two files with the same name and same modification date it should print the both. For example in this set... (6 Replies)
Discussion started by: KitFisto
6 Replies

5. Homework & Coursework Questions

How do I get at the modification date for a file as a variable for a script?

I realize this is basic and probably obvious, but I'm pulling my hair out. I'm guessing this is just some flag on the file command or somesuch, but I can't find it. Help me get unstuck please? EDIT: I guess what I'm asking is once I've got the ls -l output for a file, what command do I use to... (3 Replies)
Discussion started by: Timespike
3 Replies

6. UNIX for Dummies Questions & Answers

Last modification date without 'ls'

Hi, I'm executing a script to check if a file has been modified on a shared folder. I use this to start another script every time the file has been modified. To do this I use the 'ls' command to get the last modification date of the file. My problem is that the computer hosting the shared... (5 Replies)
Discussion started by: Peuj
5 Replies

7. OS X (Apple)

get file modification date in number format (yyyy mm dd hh mm ss)

How do i get the file modification date in number format (yyyy mm dd hh mm ss) i used ls -l pathname but month is still in text "Aug" and year and time is not allways shown. time is show if it is in this year. and year is shown if it is before this year. what do i need to get... (7 Replies)
Discussion started by: rvdokkum
7 Replies

8. Shell Programming and Scripting

Date Modification

Hello all ! I have a piece of code that generates the date of one day ago: /usr/bin/gdate --date='1 day ago' | awk '{print $2 " " $3}' Nov 3 I want the output to be in the form : Nov 03 What other operation should I do for that ? Help (2 Replies)
Discussion started by: Junaid Subhani
2 Replies

9. Programming

File date/time modification and permissions

First, oh great Unix gurus, forgive if this is a stupid question. Unix/Linux is not my main thing but I have been programming in C/C++ for many years. I will do my best to be specific. I have a program in C/C++ that needs to modify the time of a given file. Currently I do this using utime()... (5 Replies)
Discussion started by: Pug
5 Replies

10. Shell Programming and Scripting

Subtract a file's modification date with current date

SunOS -s 5.10 Generic_147440-04 sun4u sparc SUNW,SPARC-Enterprise Hi, In a folder, there are files. I have a script which reads the current date and subtract the modification date of each file. How do I achieve this? Regards, Joe (2 Replies)
Discussion started by: roshanbi
2 Replies
Locale::Codes::LangExt(3pm)				 Perl Programmers Reference Guide			       Locale::Codes::LangExt(3pm)

NAME
Locale::Codes::LangExt - standard codes for language extension identification SYNOPSIS
use Locale::Codes::LangExt; $lext = code2langext('acm'); # $lext gets 'Mesopotamian Arabic' $code = langext2code('Mesopotamian Arabic'); # $code gets 'acm' @codes = all_langext_codes(); @names = all_langext_names(); DESCRIPTION
The "Locale::Codes::LangExt" module provides access to standard codes used for identifying language extensions, such as those as defined in the IANA language registry. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default IANA language registry codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language extensions. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lext = code2langext('acm','alpha'); $lext = code2langext('acm',LOCALE_LANGEXT_ALPHA); The codesets currently supported are: alpha This is the set of three-letter (lowercase) codes from the IANA language registry, such as 'acm' for Mesopotamian Arabic. This is the default code set. ROUTINES
code2langext ( CODE [,CODESET] ) langext2code ( NAME [,CODESET] ) langext_code2code ( CODE ,CODESET ,CODESET2 ) all_langext_codes ( [CODESET] ) all_langext_names ( [CODESET] ) Locale::Codes::LangExt::rename_langext ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangExt::add_langext ( CODE ,NAME [,CODESET] ) Locale::Codes::LangExt::delete_langext ( CODE [,CODESET] ) Locale::Codes::LangExt::add_langext_alias ( NAME ,NEW_NAME ) Locale::Codes::LangExt::delete_langext_alias ( NAME ) Locale::Codes::LangExt::rename_langext_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangExt::add_langext_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangExt::delete_langext_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.iana.org/assignments/language-subtag-registry The IANA language subtag registry. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2012 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-10-11 Locale::Codes::LangExt(3pm)
All times are GMT -4. The time now is 04:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy