ls -l output with long iso format


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ls -l output with long iso format
# 1  
Old 04-16-2004
ls -l output with long iso format

Hello everbody,

I've a list of logfiles (transfer1.log, transfer2.log, ... transfer168.log.) Each of these was created at the end of the actual month and I've to write a script to calculate the utilisation ratio of the actual month of the system.

I don't want to scan every logfile, so I've to compare the creation date with the local date in the format YYYY-MM (e.g. 2004-04) and put the output in a separate file, so I've onle these files of the actual month and year.

Under Linux SuSE 9.0 i wrote this one:
Quote:
date_local=`date +%Y-%m`;
file='transfer*'
cd /var/log/
ls -l $file --time-style=long-iso | grep $date_local > /tmp/tmp_log_$date_local.log
file=`cut -b61- /tmp/tmp_log_$date_local.log`
...
The problem is, I've to run the script under Solaris and the ls prefix "--time-style=long-iso" isn't available.

Can anyone help me?
# 2  
Old 04-16-2004
Perhaps some help on this: previous thread.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies

2. Shell Programming and Scripting

Long list file display different time format.

Hi Gurus, I have some weird issue. when using ls -l the result shows different time format: -rw-r--r-- 1 abc gourp1 3032605576 Jun 14 2013 abc -rw-rw-r-- 1 abc gourp1 1689948832 Aug 10 06:22 abc one display 2013 which is year; another one displays 06:22 which is time. ... (4 Replies)
Discussion started by: ken6503
4 Replies

3. Shell Programming and Scripting

Long to wide format

hi, can you please help me convert my data i have paired comparisons (col 3) in long format for 750 variables (col 1 and 2), i need to convert into wide format. the diagonal must be 0s, and the order doesnt matter. My file is unsorted. example input A B 34 A 88 45 A A23 43 A23 B 4.5... (1 Reply)
Discussion started by: jianp83
1 Replies

4. UNIX for Dummies Questions & Answers

Converting dates to iso format

Hi , i am trying to read a tsv file record by record and change the date column with iso date format. it have different dates with format like mm/dd/yyyy HH:MM:SS EST ,i am trying serarch for the date format lke this yyyy-mm-dd HH:MM:SS EST and replace to it if dosent match that format . Any... (2 Replies)
Discussion started by: vikatakavi
2 Replies

5. Shell Programming and Scripting

Python script to convert date to iso format

Hi , This is my 1st program in python never tried any python before. i am trying to write a python script which reads a .tsv file line by line and in each line it should look for mm/dd/yyyy formate and convert it to yyyy-mm-dd formate . can some one provide be some sample code to do that. (2 Replies)
Discussion started by: vikatakavi
2 Replies

6. Shell Programming and Scripting

modify ls -l (long listing format output) strictly using SED only straightforward goalhard 4 me doh

Below is a sample out of ls -l which I would like to rearrange or modify by field numbers for example I successfully managed to disect using simple paragraph however for ls -l I can't divide the rows or fields by field number. Successful modification by fields using SED sample: $ sed -e... (1 Reply)
Discussion started by: wolf@=NK
1 Replies

7. Red Hat

How to make boot.iso image from rhel6 installation dvd iso ?

Hello Everyone, Can anyone let me know how to make minimal boot.iso from rhl6 installation dvd iso image. I have a dvd image with me but i want to make just a minimal boot media. Somehow it is not shipped with dvd iso. I know we can download boot.iso from redhat site but is there any anyway we... (5 Replies)
Discussion started by: Rohit Bhanot
5 Replies

8. Shell Programming and Scripting

sed and Output line too long

hello i try this command in console mode sed -e :a -e '/$/N; s/\(\)\n/\1 /; ta' test.txt > result.txt i have in the output screen "Output line too long" for multiples lines can you please tell me how can i retrieve those long lines during the execution ? Another thing very... (5 Replies)
Discussion started by: ade05fr
5 Replies

9. Shell Programming and Scripting

Validate long date format in If statement

Hi, I want to validate if the given input is a valid month (written in long month format) Jan / Feb / Mar / Apr / May / Jun etc etc This is what I've got with || (or statements): #!/usr/bin/ksh INPUT_DATE=$1 FORMATTED_DATE=`date | cut -f2 -d' '` #If there's no input use the... (1 Reply)
Discussion started by: Batsies
1 Replies

10. Shell Programming and Scripting

Help with find command and list in a long format each found file

The purpose of those comands are to find the newest file in a directory acvrdind to system date, and it has to be recursively found in each directory. The problem is that i want to list in a long format every found file, but the commands i use produce unexpected results ,so the output lists in a... (5 Replies)
Discussion started by: alexcol
5 Replies
Login or Register to Ask a Question