Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Help - Find command with list of files modified descending Order Post 302260405 by jim mcnamara on Thursday 20th of November 2008 12:13:38 PM
Old 11-20-2008
Code:
filetime()
{
    perl  -e '
          use POSIX qw(strftime);
          $mtime = (stat $ARGV[0])[9];
          print strftime "%Y-%m-%d:%H:%M:%S ", localtime($mtime);
         ' $1
}
find . -name '*.shl' |\
while read filename
do
        echo "$(filetime $filename) $filename"
done | sort

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to see disk usage in descending order

What is the command used by sysadmin to see the disk used by the users in descending order of their disk usage? (8 Replies)
Discussion started by: asutoshch
8 Replies

2. Shell Programming and Scripting

Ascending & Descending order numbers

Dear All, I have below attached file in which i have many nos, i want the last ascending order nos. The brief description is given below. File 315 381 432 315 381 432 315 381 432 315 381 432 315 381 432 (6 Replies)
Discussion started by: pravani1
6 Replies

3. UNIX for Advanced & Expert Users

Display modified files in ascending order

Hello, i want to display modified files in descending order. "ls -t" will display modified files in descending order. pls help. (1 Reply)
Discussion started by: balareddy
1 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. UNIX for Dummies Questions & Answers

how to list descending order

Hi, I want to short descending all the files according to their size.Please help me.. (1 Reply)
Discussion started by: jyotidas
1 Replies

6. Shell Programming and Scripting

Help with sort data based on descending order problem

Input file 9.99331e-13 8.98451e-65 9.98418e-34 7.98319e-08 365592 111669 74942.9 0 Desired output 365592 111669 74942.9 7.98319e-08 1.99331e-13 6.98418e-34 (2 Replies)
Discussion started by: perl_beginner
2 Replies

7. Shell Programming and Scripting

script for remove descending order number

hi all i want to remove some descending order number example : 1 100 200 135.00 Gk_wirs 1 1 100 200 136.00 Gk_wirs 50 1 110 210 138.00 Gk_wirs 60 1 100 200 136.00 Gk_wirs 57 ----> how to remove... (6 Replies)
Discussion started by: nithyanandan
6 Replies

8. Shell Programming and Scripting

Find list of files modified for a given day ?

find list of files modified for a given day ? if i have 10 files in my directory, i have modified only 5 ... how to display only modified files ? (1 Reply)
Discussion started by: only4satish
1 Replies

9. UNIX for Dummies Questions & Answers

Find command to get the modified files past 2 hours

Hello, How to get the modified/created files past 2 hours in Solaris with find command? Thank you. (7 Replies)
Discussion started by: balareddy
7 Replies

10. Shell Programming and Scripting

How to sort list of directories in descending order in perl?

Hi, I have a problem . I have few directories like inpTDT_1, inpTDT_2, inpTDT_3 and so on inside HOME directory . In one of my perl script (which is in my HOME), the above directories like inpTDT_1, inpTDT_2, inpTDT_3 are sorting out in an order So I wanted to sort all the inpTDT_1, inpTDT_2,... (1 Reply)
Discussion started by: venkatesh
1 Replies
sa(8)							      System Manager's Manual							     sa(8)

NAME
sa - Summarizes accounting records SYNOPSIS
sa [-abcdDfijkKlmnorstu] [-v Number] [-S SaveFile] [-U UserFile] [File] The sa command helps you manage the large volume of accounting information that is generated each day when system accounting has been enabled by the system administrator or by the superuser. FLAGS
Outputs all command names (including those containing unprintable characters and commands used only once) in the last column. In the default format, such commands are summed and the total is written as the entry ***other. Sorts cpu output column 3 according to the sum of user and system CPU time divided by the amount of CPU time required to execute the command entered in the last column (6) as many times as is entered in the first column (1). Adds three percentage columns to the default format to list percentages as follows: Lists the percent- age of the number of times each command was executed with respect to the total number of times all commands were executed (see 1a below). Lists the percentage of the amount of real time required to execute each command the number of times entered in the first column with respect to the total real time required to execute the total of all commands entered in the last column (see 2a below). Lists the percent- age of the amount of command CPU time required to execute each command the number of times entered in the first column with respect to the total CPU time required to execute the total of all commands entered in the last column (see 3a below). Sorts avio output column (4) in descending order according to the average number of disk I/O operations. Substitutes tio column (4a) for the avio (4) column and sorts tio output column 4a in descending order according to the total number of disk I/O operations. Used with the -v flag to inhibit interactive threshold comparison of commands. Reads raw database file /var/adm/pacct only. Does not include records from summary database file /var/adm/savacct. Outputs the average number of seconds per command in default columns 2, 3, and 4 instead of the total time in minutes for the number of calls entered in column 1 for each command. Sorts and outputs records according to the value in the k output column 5 in descending order. Substitutes k*sec column (5a) for the k (5) column and sorts the k*sec output column in descending order according to the value of the memory time integral. Separates cpu column 3 into two columns. The new column entries are column 3a, which lists the s (system) part of the CPU minutes, and column 3b, which lists the u (user) part of the CPU minutes. Outputs a 5-column file, which provides the information in the following table. Listed below in left-to-right order are the column identification suffixes, or none when no suffix is used, and the purpose of the column. Some columns are identical to the default output format described in the table in the DESCRIPTION section; these are marked with *. Username or user ID as written in the /etc/passwd file. The total number of processes executed by the user during the accounting period. Same as column 3 in the default output file. Same as column 4a in the default output file. Same as column 5a in the default output file. Outputs the default format sorted in descending order according to the number of times each command was called. Substitutes, in the default output format, the ratio of user CPU time (u) to system CPU time (s) as u/s in column 3 in place of the total user and system CPU time (cpu) for the number of calls entered in the first column. The default format, described under Description, is resorted in ascending order according to the values entered in column 3, cpu time. This sort is the reverse of the default sort. Merges information in accounting database file /var/adm/pacct with summary files you specify with the -U and -S flags, or merges the database file information with information in default files /var/adm/usracct or /var/adm/savacct. After the merge, database file /var/adm/pacct is truncated. The use of this flag also implies the use of the -a flag. Uses SaveFile as the command summary file in place of file /var/adm/savacct. Adds the re/cp column (3d) to the default format. Entries in this column express the ratio of real time to total (cpu) time, which is the sum of user and system time for each command entered in the last column. Suspends all other flags and prints the user numeric ID, the CPU time, memory usage, number of I/O operations, and the command name for each command. Uses UserFile as the user summary file in place of file /var/adm/usracct to record per-user statistics output with the -m flag. Prints, as a query, the name of each command used Number times or fewer to the standard output as follows: command-- where command-- is the name of the command written to the standard output by sa. When you respond by typing y to the standard input, the command record is omitted from a default-formatted list at the end of the interac- tive command queries written to the standard output. The columnar values of the omitted record are totaled in an added record whose command name is **junk** in the last column of that list. When you type any other character, the record for the queried command name remains in the default output list at the end of the interactive commands written to the standard input. DESCRIPTION
When you use the -s flag with the sa command, the information in /var/adm/pacct is condensed into summary file /var/adm/savacct, which con- tains a count of the number of times each command was called and the amount of time system resources were used. Condensed information for each user is stored in /var/adm/usracct. This condensed-information file conserves storage space because on a large system the /var/adm/pacct daily process file can grow by as many as 100 blocks per day. Summary files are normally read before accounting files are, so that files produced by sa include all available information. When a filename is given as the last argument, the named file is treated as the process accounting file. The /var/adm/pacct file is the default process accounting file. When the sa command is invoked with no flags, the default output summary is an unheaded 6-column file consisting of, in some cases, infor- mation having an identification suffix in the column. The identification suffix may be changed from the default (no flags specified) output format by using various flags. The following table lists the columns with left-to-right reference column numbers (not included in output) for the default format on the left, the identification suffix for the entry when one is used (or none when one is not in the middle), and the purpose of the information in that column on the right. Columns having more than one identification suffix description (2 and 2a, for example) use the alternate suffix designation in the same sa output printout column for each of the listed alternate entries for the column. For example, the second column has two possible suffix designations: re and %. The re reference in the middle column describes the information in the second column of the output printed by the sa command when this suffix is used. Correspondingly, the % reference describes the information in the sa output when the % suffix is used. 1 none The number of times the command entered in the last column (6) was called. 1a % When the -c flag is used, sa adds this column after column 1 to list the number of times the command was called (entered in column 1) as a percentage of the total number of times all commands entered in the last column were called. 2 re The number of real-time (elapsed) minutes required to execute the command entered in the last column (6) as many times as is entered in the first column (1). 2a % When the -c flag is used, sa also adds this column after col- umn 2 to list the amount of real time (entered in column 2) required to process the command entered in the last column (6) as many time as is entered in the first column (1), as a percentage of the total amount of real time required to process all of the commands listed in the last column. 3 cpu The number of CPU (user plus system) minutes used to execute the command entered in the last column (6) as many times as is entered in the first column (1). 3a u The number of user CPU minutes used. 3b s The number of system CPU minutes used. 3c u/s When the -o flag is used, substitutes u/s column (3c) for the cpu (3) column and sorts the u/s output column in descending order according to the ratio of user CPU time to system CPU time. 3d % When the -c flag is used, sa also adds this column after col- umn 3 to list the amount of CPU time (entered in column 3) required to process the command, entered in the last column, the number of times, entered in the first column, as a per- centage of the total CPU time required to process all of the commands listed in the last column. 3e re/cpu When the -t flag is used, adds the re/cpu column to the default output format. Entries in this column express the ratio of real CPU process time to total CPU time (cpu), which includes user and system time. These entries appear after entries for the cpu (3) column. The default output sort remains unchanged. 4 avio The average number of input/output operations for each listed command. 4a tio The total number of input/output operations for each listed command. 5 k The average number of kiloblocks (blocks x 1024) of memory used for each command process. 5a k*sec CPU storage-time integral in K-core seconds (seconds x 1024). 6 none The command name (a trailing * [asterisk] indicates a forked program). Other considerations for entries in the printed sa output are as follows: All times are expressed to nearest one hundredth. The default format is sorted in descending order according to the values entered in column 3, cpu time. You should not share accounting files among nodes in a distributed environment. Each node should have its own copy of the various accounting files. When you are also using /usr/sbin/acct/* accounting commands, do not delete accounting records in the /var/adm/pacct process accounting source file because these records also provide information for summary data files when the -s option is used. EXAMPLES
To summarize accounting records for all commands entered in the /var/adm/pacct process database file, enter: sa -a Commands used only once are summed with the entry ***other in the last column of the default output format. To summarize accounting records according to the average number of kiloblocks of memory used for each command, enter: sa -k FILES
Specifies the command path Process accounting database file. System process accounting summary file. User process accounting summary file. RELATED INFORMATION
Commands: acct(8), acctcms(8), acctcom(8), acctcon(8), acctmerg(8), acctprc(8), fwtmp(8), runacct(8) delim off sa(8)
All times are GMT -4. The time now is 04:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy