Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to find out the exact year in "Last modified time" using ls command Post 302070975 by Dophlinne on Tuesday 11th of April 2006 02:52:50 AM
Old 04-11-2006
Error How to find out the exact year in "Last modified time" using ls command

Hi,

I understand that the ls command with "-l" option generates the "last modified time" of specific directory.

However, some generated results displayed the "last modified time" with detail about the last modified year, for example:

-rwxrwxrwx+ 1 smith dev 10876 May 16 2005 part2

some results, on the other hand, only display the detail about the time but not the year, for example:

-rwxrwxrwx+ 1 smith dev 10876 May 16 9:42 part2

I would appreciate if anybody could tell me how to find out the last modified year if I got the latter result, i.e. output with last modified time only.

Thank you.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

"find command" to find the files in the current directories but not in the "subdir"

Dear friends, please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories.. it is like this, current directory contains file1, file2, file3, dir1, dir2 and dir1 conatins file4, file5 and dir2 contains file6,... (9 Replies)
Discussion started by: swamymns
9 Replies

2. UNIX for Advanced & Expert Users

add seconds to: date"|"time"|"HHMMSS

Hey all, I have a shell that invokes a AWK. In this AWK i want invoke a function that receives 3 parameters: date: 20080831 time: 235901 duration: 00023 that function receive this 3 parameters and sum to this value two more seconds: 2008083123590100025 Remember that in case that... (3 Replies)
Discussion started by: anaconga
3 Replies

3. Shell Programming and Scripting

How to remove "New line characters" and "spaces" at a time

Dear friends, following is the output of a script from which I want to remove spaces and new-line characters. Example:- Line1 abcdefghijklmnopqrstuvwxyz Line2 mnopqrstuvwxyzabcdefghijkl Line3 opqrstuvwxyzabcdefdefg Here in above example, at every starting line there is a “tab” &... (4 Replies)
Discussion started by: anushree.a
4 Replies

4. UNIX for Advanced & Expert Users

command for recently modified files - "find" command not working

I have three files a.txt , b.txt , c.txt in a directory called my_dir1 .These files were created before two or three months . I have a tar file called my_tar1.tar which contains three files a.txt , b.txt , d.txt . Somebody untarred the my_tar1.tar into my_dir1 directory. So existing two files were... (1 Reply)
Discussion started by: joe.mani
1 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

Problem with "find" and "grep" command

I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank). In a first approach I coded: find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt But this doesn't work. I got an error (under Ubuntu): grep:... (5 Replies)
Discussion started by: pstein
5 Replies

7. Shell Programming and Scripting

"ps -ef" command and exact matching

Hi Guys, I am working in ksh88 and need the output of "ps -ef" command to give me the exact match of my pattern, for example: $ ps -ef 'gen_sub' UID PID PPID NLWP PGID SID STIME TIME COMMAND op 9209 8249 1 9209 9209 14:52:57 00:00 /usr/bin/ksh... (3 Replies)
Discussion started by: aoussenko
3 Replies

8. Shell Programming and Scripting

Find lines with "A" then change "E" to "X" same line

I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies

9. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

10. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
samlog_viewer(1)					      General Commands Manual						  samlog_viewer(1)

NAME
samlog_viewer - a tool for viewing and saving the SAM logfile SYNOPSIS
mmddhhmm[[cc]yy]] mmddhhmm[[cc]yy]] user] ofile] [file] DESCRIPTION
The command enables the viewing of part or all of the SAM logfile (or another file containing data in the same format) at varying levels of detail. This tool is run by SAM whenever the option is chosen. It can also be run independently of SAM, in either interactive or nonin- teractive mode. The command executes in either interactive or noninteractive mode, depending on the options given. In noninteractive mode, filters the source file and writes the resulting data either to stdout or to a destination file. In interactive mode, displays a graphical user inter- face enabling you to try different combinations of filtering, save one or more versions of the source file to other files, scroll back and forth among the logfile entries, etc. Under no circumstances is destructive to the contents of the SAM logfile (or whatever source file is specified by file). The contents of the source file are filtered and displayed (or output) according to the settings of the available filters. Multiple instances of can be run simultaneously without harmful effects. Filters supports three types of filters: level of detail, date/time, and user filters. These filters can be used in combination to provide highly selective logfile viewing. The level of detail filters control how much detail is displayed. The SAM logfile may contain entries of many different types. The entry types currently supported are: summary, detail, verbose, error, and note. The level of detail filters display some or all of these entry types, depending on which filter is chosen. The level of detail filters are: Displays only the higher level messages. These include summary, error, and note (warnings, other entries worthy of special attention) entry types. Includes level of detail, and adds detail log entries. If no level of detail is specified, this is the default. Includes level of detail, and adds verbose log entries. Displays only the literal commands that were executed. These commands may include HP-UX commands as well as SAM commands and scripts. The date/time filters are used to ask for entries written since a specific date/time, before a specific date/time, or both. The user filters are for viewing only those entries written by a particular user. If invoked with the option, its argument is used as the user whose entries should be shown. If user filtering is selected by the option, displays only entries made by that user and disallows any changes to the user filtering. This is useful for allowing nonprivileged users to run and see only those entries that pertain to them. Otherwise, allows the user filtering to be changed, or completely disabled, from its interactive filtering screen. Options The following options enable you to set up filtering and other attributes. If runs interactively, these attributes may also be set and modified in the various supported menus and displays. The available options are: The option sets the start date/time filter to the date/time given by its argument. The date/time is specified in the same way as it is for the command (see date(1)): mm Month specified as a two digit number (e.g., dd Day specified as a two digit number. hh Hour specified as a two digit number (24-hour clock form). mm Minute specified as a two digit number. cc Century minus one. cc is optional when specifying the year. yy The last two digits of the desired year. If this is not specified, the current year is used. To specify a year in two digits, the valid ranges are 70-99 (20th century) and 00-37 (21st century). To specify a year in four digits, the valid range is 1970-2037. If no start time is given, the beginning of the log is used as the start time. The option sets the end date/time filter to the date/time given by its argument. The date and time is speci- fied as described above for the option. If no end time is given, then an end date/time of infinity (no end time) is used. The option sets the desired level of detail. One of the letters must be specified as the required argument. The level of detail is set as follows: If the option is not specified, the level of detail is used by default. The option sets the user filter to the user name or user ID specified by user. Only entries logged by this user are displayed. If the option is omitted, entries logged by all users are displayed by default. The option causes the filtered output to be written to the output file ofile. The option implies the option described below. If ofile is the output is written to stdout. If is omitted, the output is written to either stdout (if is specified) or to the interactive display (if is omitted). The option enables automatic timestamping. If specified, each log entry is tagged with the time of day at which it was written. Timestamping is disabled by default. The option forces noninteractive behavior. If specified, runs noninteractively, using the default or specified values for all supported options and source/destination files. file Specifies the name of the file from which log data is read. The format of the data in the specified file must be the same as that used for raw SAM logfile data. If omitted, the SAM logfile is read. If file is stdin is read and runs noninteractively. If given, file must be the last argument specified on the command line. EXAMPLES
Capture the current contents of the SAM logfile using default filtering, and put into the file The following example does the same thing: View only the commands executed by SAM on behalf of user between 8am June 5, 1994 and 10pm August 14, 1994, and view the data interac- tively: Noninteractively read data from stdin, timestamp it, and save the result in a file called Do the same as above, but instead have the data appear on stdout: or FILES
SAM logfile. Archived version of created when the logfile is automatically trimmed by SAM when its size becomes too large. Its contents are included in the log entries read by Temporary files used by SEE ALSO sam(1M). samlog_viewer(1)
All times are GMT -4. The time now is 03:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy