Sponsored Content
Full Discussion: Ls -ltr in scripting
Top Forums Shell Programming and Scripting Ls -ltr in scripting Post 302947015 by wisecracker on Sunday 14th of June 2015 03:14:09 PM
Old 06-14-2015
Longhand using OSX 10.7.5, default terminal using sh...
Think of your problem and adapt. As you were attempting to use builtins then 'KIS', (Keep It Simple).
Code:
Last login: Sun Jun 14 20:01:53 on ttys000
AMIGA:barrywalker~> sh
AMIGA:barrywalker~> ls -ltr > /tmp/listing
AMIGA:barrywalker~> while read line; do echo "List of files $line"; done < /tmp/listing
List of files total 3056
List of files drwxr-xr-x+  5 barrywalker  staff     170 29 Mar  2013 Public
List of files drwxr-xr-x   3 barrywalker  staff     102  6 May  2014 URL
List of files drwx------+  5 barrywalker  staff     170 17 Oct  2014 Music
List of files drwx------+  5 barrywalker  staff     170 17 Oct  2014 Pictures
List of files drwx------+  4 barrywalker  staff     136 17 Oct  2014 Documents
List of files drwx------@ 38 barrywalker  staff    1292 24 Oct  2014 Library
List of files -rwxr-xr-x   1 barrywalker  staff  128656 22 Nov  2014 03080.sh
List of files -rwxr-xr-x   1 barrywalker  staff  128990  6 Dec  2014 03083.sh
List of files -rwxr-xr-x   1 barrywalker  staff  131697  7 Dec  2014 03090.sh
List of files -rwxr-xr-x   1 barrywalker  staff  134772 29 Dec 21:05 03100.sh
List of files -rwxr-xr-x   1 barrywalker  staff  135072 30 Jan 20:30 03120.sh
List of files drwxr-xr-x  42 barrywalker  staff    1428  2 Feb 22:14 Scope
List of files -r--------   1 barrywalker  staff  140746  3 Apr 11:32 03140.sh
List of files drwxr-xr-x  15 barrywalker  staff     510  6 Apr 18:16 sox-14.4.0
List of files -rw-r--r--   1 barrywalker  staff  146294  9 May 17:02 03180.sh
List of files -rwxr-xr-x   1 barrywalker  staff  146712 19 May 19:25 AudioScope.txt
List of files -rwxr-xr-x   1 barrywalker  staff    1452 23 May 23:26 AAWG
List of files drwx------+ 11 barrywalker  staff     374 30 May 14:29 Desktop
List of files drwx------+  5 barrywalker  staff     170  1 Jun 15:44 Movies
List of files -rwxr-xr-x   1 barrywalker  staff  147913  1 Jun 22:02 AudioScope.sh.txt
List of files -rw-r--r--   1 barrywalker  staff  147913  2 Jun 18:59 03197.sh
List of files -rwxr-xr-x   1 barrywalker  staff  149973  2 Jun 22:15 AudioScope.sh
List of files drwx------+ 18 barrywalker  staff     612 11 Jun 09:59 Downloads
AMIGA:barrywalker~> exit
exit
AMIGA:barrywalker~> exit
logout

[Process completed]

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

what does the ls -ltr command list

Hi, THe following is the output when i run the command ls -ltr can anyone explain the meaning of the field in red -rw-r----- 3 orca orca 20924 Sep 08 19:21 BTL027SASI.gnt -rw-r----- 3 orca orca 20924 Sep 08 19:21 BTL027RITD.gnt -rw-r----- 3 orca orca ... (2 Replies)
Discussion started by: ranjita.c
2 Replies

2. UNIX for Advanced & Expert Users

ls -ltr, TIME DETAILS ??

when I write the command ls -ltr it shows the detail of the files. Like -rwxrwxrwx 1 mqsiadm mqbrkrs 0 Aug 29 14:03 dspmq_temp -rwxrwxrwx 1 mqsiadm mqbrkrs 666 Aug 30 06:12 dspmq_script In this,DATE TIME is shown, Now the question is : how can I see the all the times... (5 Replies)
Discussion started by: varungupta
5 Replies

3. Shell Programming and Scripting

ls -ltr help

i have to list some file with certain exemption suppose for example i have two files file1.log.1 file1.log.1.123 i want ls -ltr command to list only 1st type of files so i want like this ls -ltr *.log.*---------it should grep 1st kind of files but this command greps all the files... (4 Replies)
Discussion started by: ali560045
4 Replies

4. Shell Programming and Scripting

ls -ltr command On Remote server

I am writing a script where in i have to log into a remote machine and check for necessary file by typing (ls -ltr *200505) (this gets all 05month of 2008 yr files) and if files are found get them to the local machine. If not found print a message saying no files on local machine. When i was... (2 Replies)
Discussion started by: vasuarjula
2 Replies

5. Shell Programming and Scripting

How to parse the listing (ls -ltr)

Hi, I need to parse the listing (ls -ltr) in a given directory and get a particular value to see the success or failure. e.g drwxr-xr-x 5 sensr vpnuser 512 Nov 7 07:46 disc_001811. Here i need to take the value 5 which is after drwxr-xr-x . how to so the same in shell... (1 Reply)
Discussion started by: MuthuAlagappan
1 Replies

6. Solaris

using ls -ltr : display only last four file names

Hi , Server details – Machine hardware: sun4u OS version: 5.9 Processor type: sparc Hardware: SUNW,Sun-Fire-880 When I put ls –ltr command I get – /users/testuser> ls -ltr -rw-rw-r-- 1 testuser dba 76 Jan 13 2009 ftp.scr -rwxr-xr-x 1... (6 Replies)
Discussion started by: rahulbahulekar
6 Replies

7. UNIX for Dummies Questions & Answers

Not able to run ls -ltr

Hi , Whenever i try to execute ls with l as an option the system hangs. The workload on server is not more than 1. What could be the reason . Normal ls works fine but ls -l causes the system to hang. This is happening when i m in /usr/local/sbin directory. I can see that the... (4 Replies)
Discussion started by: pinga123
4 Replies

8. Programming

Ls -ltr Sort multiple columns

Hi All, I have one requirement, where I need to have output of ls -l command sorted on 1) first on filename 2) last modified time ( descending ) - latest change first. I am not able to figure out how to do it.. Also I dont have a way to change Date display for ls -ltr command.. I am... (1 Reply)
Discussion started by: freakabhi
1 Replies

9. Shell Programming and Scripting

I have two commands “ls -h” and “ls -ltr”. How do i make sure “ls -ltr” is run after “ls -h” is suc

help me (2 Replies)
Discussion started by: sonu pandey
2 Replies

10. Shell Programming and Scripting

Fields in the Output of ls -ltr for a directory

Could you please let me know what each of the output fields in ls -ltr for a directory imply. Example : drwxrwsr-x 4294967295 infamgr infagrp 2147549184 Sep 2 17:01 job basically would want to know 4294967295 and 2147549184 (6 Replies)
Discussion started by: infernalhell
6 Replies
PAPS(1) 						      General Commands Manual							   PAPS(1)

NAME
paps - UTF-8 to PostScript converter using Pango SYNOPSIS
paps [options] files... DESCRIPTION
paps reads a UTF-8 encoded file and generates a PostScript language rendering of the file. The rendering is done by creating outline curves through the pango ft2 backend. OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. --landscape Landscape output. Default is portrait. --columns=cl Number of columns output. Default is 1. Please notice this option isn't related to the terminal length as in a "80 culums terminal". --font=desc Set the font description. Default is Monospace 12. --rtl Do right to left (RTL) layout. --paper ps Choose paper size. Known paper sizes are legal, letter and A4. Default is A4. Postscript points Each postscript point equals to 1/72 of an inch. 36 points are 1/2 of an inch. --bottom-margin=bm Set bottom margin. Default is 36 postscript points. --top-margin=tm Set top margin. Default is 36 postscript points. --left-margin=lm Set left margin. Default is 36 postscript points. --right-margin=rm Set right margin. Default is 36 postscript points. --gutter-width=gw Set gutter width. Default is 40 postscript points. --help Show summary of options. --header Draw page header for each page. --markup Interpret the text as pango markup. --lpi Set the lines per inch. This determines the line spacing. --cpi Set the characters per inch. This is an alternative method of specifying the font size. --stretch-chars Indicates that characters should be stretched in the y-direction to fill up their vertical space. This is similar to the texttops behaviour. AUTHOR
paps was written by Dov Grobgeld <dov.grobgeld@gmail.com>. This manual page was written by Lior Kaplan <kaplan@debian.org>, for the Debian project (but may be used by others). April 17, 2006 PAPS(1)
All times are GMT -4. The time now is 12:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy