Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Storing timestamp of files in an array Post 303001138 by nextStep on Thursday 27th of July 2017 10:11:30 AM
Old 07-27-2017
Please find the answer
/bin/bash

GNU bash, version 4.2.46(1)-release (x86_64-redhat-linux-gnu)

CentOS Linux release 7.3.1611 (Core)
Red Hat Enterprise Linux Server release 7.0 (Maipo)
NAME="CentOS Linux"
VERSION="7 (Core)"

---------- Post updated at 09:11 AM ---------- Previous update was at 08:04 AM ----------

Code:
find /home/user -type f -name "*.json" -printf '%Tc %p\n' | awk {'print $1 " " $2 " " $3 " " $4 " " $5 " " $6 " " $7'}


Last edited by rbatte1; 07-27-2017 at 11:46 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Storing pointer array in C

All .. I am having a pointer array . And trying to store the addess into that pointer array . please see below the problem i faced code: int cnt1; char *t_array; char *f_array; for(cnt1=0; cnt1<1000; cnt1++) { t_array =... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

2. Shell Programming and Scripting

storing variables in array.Please help

Hi All, I need some help with arrays. I need to take input from the user for hostname, username and password until he enters .(dot) or any other character and store the values in the variable array. I would further connect to the hostname using username and passwd and copy files from server to... (7 Replies)
Discussion started by: nua7
7 Replies

3. Shell Programming and Scripting

storing records in awk array

hi i have a file as follows: 1 2 3 4 5 6 i want to store all these numbers in an array using awk.. so far i have: awk '{for(i=1;i<=NR;i++) {a=$1}} END {for(i=1;i<=NR;i++) {printf("%1.11f",a)}}' 1.csv > test however, i am getting all values as zero in the "test" file..... (3 Replies)
Discussion started by: npatwardhan
3 Replies

4. Shell Programming and Scripting

storing values in a list or array

i have a file called file.txt having the following entries. 2321 2311 2313 4213 i wnat to store these values in a list and i want to iterate the list using loop and store it in another list (1 Reply)
Discussion started by: KiranKumarKarre
1 Replies

5. Shell Programming and Scripting

Storing blanks in an array in bash

Hi Guys, I have a file which is as follows: 1 2 4 6 7 I am trying to store these values in an array in bash. I have the following script: FILE=try.txt ARRAY=(`awk '{print}' $FILE`) echo ${ARRAY} (3 Replies)
Discussion started by: npatwardhan
3 Replies

6. Shell Programming and Scripting

Storing data in perl 2D array

Respected All, Kindly help me out. I have got file listings in a directory like this: -rw-r--r-- 1 root root 115149 2011-11-17 07:15 file1.stat.log -rw-r--r-- 1 root root 115149 2011-11-18 08:15 file2.stat.log -rw-r--r-- 1 root root 115149 2011-11-19 09:15 file3.stat.log -rw-r--r-- 1... (2 Replies)
Discussion started by: teknokid1
2 Replies

7. Programming

C; storing strings in an array

I am trying to get userinput from stdin and store the lines in an array. If i do this: using a char **list to store strings allocate memory to it #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv) { char *prog = argv; char **linelist; int... (5 Replies)
Discussion started by: tornow
5 Replies

8. Shell Programming and Scripting

Storing command output in an array

Hi, I want keep/save one command's output in an array and later want to iterate over the array one by one for some processing. instead of doing like below- for str in `cat /etc/passwd | awk -F: '$3 >100 {print $1}' | uniq` want to store- my_array = `cat /etc/passwd | awk -F: '$3 >100 {print... (4 Replies)
Discussion started by: sanzee007
4 Replies

9. Shell Programming and Scripting

Storing the SQL results in array variables

Requirement 1) I need to execute 15 SQL queries in oracle through linux script. All these query results needs to be stored in array variables. Requirement 2) And these 15 queries needs to be executed in parallel. Requirement 3) Once all the queries executed then the shell script should... (3 Replies)
Discussion started by: Niranjancse
3 Replies

10. Shell Programming and Scripting

Storing two dimensional array for postprocessing

Hi Community, Would love to get some quick help on below requirement. I am trying to process mpstat output from multiple blades of my server I would like to assign this the output to an array and then use it for post processing. How can I use a two dimensional array and assign these value ... (23 Replies)
Discussion started by: sshark
23 Replies
SD_JOURNAL_GET_REALTIME_USEC(3) 			   sd_journal_get_realtime_usec 			   SD_JOURNAL_GET_REALTIME_USEC(3)

NAME
sd_journal_get_realtime_usec, sd_journal_get_monotonic_usec - Read timestamps from the current journal entry SYNOPSIS
#include <systemd/sd-journal.h> int sd_journal_get_realtime_usec(sd_journal* j, uint64_t* usec); int sd_journal_get_monotonic_usec(sd_journal* j, uint64_t* usec, sd_id128_t* boot_id); DESCRIPTION
sd_journal_get_realtime_usec() gets the realtime (wallclock) timestamp of the current journal entry. It takes two arguments: the journal context object and a pointer to a 64-bit unsigned integer to store the timestamp in. The timestamp is in microseconds since the epoch, i.e. CLOCK_REALTIME. sd_journal_get_monotonic_usec() gets the monotonic timestamp of the current journal entry. It takes three arguments: the journal context object, a pointer to a 64-bit unsigned integer to store the timestamp in, as well as a 128-bit ID buffer to store the boot ID of the monotonic timestamp. The timestamp is in microseconds since boot-up of the specific boot, i.e. CLOCK_MONOTONIC. Since the monotonic clock begins new with every reboot, it only defines a well-defined point in time when used together with an identifier identifying the boot. See sd_id128_get_boot(3) for more information. If the boot ID parameter is passed NULL, the function will fail if the monotonic timestamp of the current entry is not of the current system boot. Note that these functions will not work before sd_journal_next(3) (or related call) has been called at least once, in order to position the read pointer at a valid entry. RETURN VALUE
sd_journal_get_realtime_usec() and sd_journal_get_monotonic_usec() returns 0 on success or a negative errno-style error code. If the boot ID parameter was passed NULL and the monotonic timestamp of the current journal entry is not of the current system boot, -ESTALE is returned by sd_journal_get_monotonic_usec(). NOTES
The sd_journal_get_realtime_usec() and sd_journal_get_monotonic_usec() interfaces are available as a shared library, which can be compiled and linked to with the libsystemd-journal pkg-config(1) file. SEE ALSO
systemd(1), sd-journal(3), sd_journal_open(3), sd_journal_next(3), sd_journal_get_data(3), sd_id128_get_boot(3), clock_gettime(2), sd_journal_get_cutoff_realtime_usec(3) systemd 208 SD_JOURNAL_GET_REALTIME_USEC(3)
All times are GMT -4. The time now is 06:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy