Sponsored Content
Full Discussion: File Listing, with a Twist?
Top Forums Shell Programming and Scripting File Listing, with a Twist? Post 303039845 by LinQ on Wednesday 16th of October 2019 09:05:30 AM
Old 10-16-2019
File Listing, with a Twist?

Greetings!

I have a quick question which must be deferred to those with greater skill than myself Smilie

In this situation, I wish to create a list of all the files on an entire partition in descending order sorted by date. I tried numerous switches for ls, and found this line to be the closest approximation to what I'm looking for:

Code:
ls -oadtR --color=never $PWD/* ./*

There are a couple of problems with the output, however:
  • The files so listed are sub-grouped within folders/directories.
  • The listings themselves contain extraneous information which includes permissions, owner, file size, etc.


In short, I simply need the modification date/time and the full path to every file listed in turn only; not grouped by directory or anything else.

Seemed to be simple enough at first blush; but here I am...

Any ideas/thoughts???

Thank you so much!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how do I log into this machine - with a twist...

I know this topic has been covered in one form or another, but it hasn't been covered to handle my problem. I was given a Sparc4 running Solaris 2.5.1 The root password is unknown. This machine has no cdrom drive and it has no floppy drive. I tried booting into the single user mode, but... (1 Reply)
Discussion started by: xyyz
1 Replies

2. UNIX for Dummies Questions & Answers

Recursive directory listing without listing files

Does any one know how to get a recursive directory listing in long format (showing owner, group, permission etc) without listing the files contained in the directories. The following command also shows the files but I only want to see the directories. ls -lrtR * (4 Replies)
Discussion started by: psingh
4 Replies

3. Shell Programming and Scripting

Compare 2 files yet again but with a twist

Ok so I have a file which contains 2 columns/fields and I have another file with 2 columns. The files look like: file1: 1 33 5 345 18 2 45 1 78 31 file2: 1 c1d2t0 2 c1d3t0 3 c1d4t0 4 c1d4t0 5 c2d1t0 6 c2d1t0 7 c2d1t0 8 c2d1t0 9 c2d1t0 10 c2d1t0 (11 Replies)
Discussion started by: Autumn Tree
11 Replies

4. UNIX for Advanced & Expert Users

building a kernel (with a twist)

Hey all, I am working on a static analysis tool and I wan't to see if it can find bugs in the linux kernel, it uses LLVM framework to analyse the instructions. Long story short I need to build the kernel with a custom compiler. The compiler will create byte code files where binaries usually... (2 Replies)
Discussion started by: zigga15
2 Replies

5. UNIX for Dummies Questions & Answers

file count with a twist

Hello Everyone, I am using the korn shell. I was hoping to find a set of commands to count files in a directory. I am using: ls /home/name/abc* | wc -l This command works fine when a file matches abc* (returns only the file count) , however when no file(s) are found I get... (2 Replies)
Discussion started by: robert4732
2 Replies

6. Shell Programming and Scripting

Incrementing with a twist - please help

I'm currently trying to write a ksh or csh script that would change the name of a file found in directories and attach to the name an incrementing three digit number. I know how to write a script that will go: 000, 001, 002, 003, etc The twist is I need more increments then allowed by a 3... (11 Replies)
Discussion started by: Rust
11 Replies

7. Shell Programming and Scripting

Simple two file compare with twist

I have file1 and file2 I lookup field3 from file2 in field1 of file1 and if there is a match, output field 2,3,5 from file2. I now want to add field2 of file1 in the output. I suspect what I have to do is read the entire line of file1 into a 2 dim array? pls help. here is my code: ... (9 Replies)
Discussion started by: jack.bauer
9 Replies

8. UNIX for Dummies Questions & Answers

[Solved] How to remove listing of current user cmd from ps -ef listing?

Hi All, Could you please help to resolve my following issues: Problem Description: Suppose my user name is "MI90". i.e. $USER = MI90 when i run below command, i get all the processes running on the system containing name MQ. ps -ef | grep MQ But sometimes it lists... (8 Replies)
Discussion started by: KDMishra
8 Replies

9. Shell Programming and Scripting

Multiple File renaming with a twist

Hi I can do simple file renaming but this task is slightly more troublesome Ive got a guy that gives me multiple .pdf filles in a directory named something like 3412345.pdf 4565465.pdf 8534534.pdf And he also gives me a html file which is tabled with which shows the filenames above... (2 Replies)
Discussion started by: messiah1
2 Replies

10. Shell Programming and Scripting

Simple two file compare with twist

I have file1 and file2 I lookup field3 from file2 in field1 of file1 and if there is a match, output field 2,3,5 from file2. I now want to add field2 of file1 in the output. I suspect what I have to do is read the entire line of file1 into a 2 dim array? pls help. (1 Reply)
Discussion started by: tmonk1
1 Replies
uuls(1M)																  uuls(1M)

NAME
uuls - list spooled uucp transactions grouped by transaction SYNOPSIS
[directories]... [directories]... [directories]... DESCRIPTION
The commands, including are targeted for removal from HP-UX; see the below. This command lists the contents of UUCP spool directories (default with the files in each directory grouped into three categories: o Transactions, o Orphans, and o Others. Transactions Each output line starts with a transaction control filename, and includes the name of each local (same-directory) subfile referenced by the control file (see below). Each is possibly followed by the total size in bytes option) or Kbytes option) in the transaction (see below). The (meanings) option replaces the subfile names with nodename, user, and commandline information (see below). Orphans All subfiles not referenced by any control file. Others All other files in the directory (all files not listed under one of the above categories). Filenames are formatted into columns, so there can be more than one file per line. If a transaction has more subfiles than fit on one line, it is followed by continuation lines which are indented further. The (size in bytes) and (Kbytes) options cause the command to follow each transaction in the section with a total size for all stat-able, sendable files in that transaction. This includes files only, not or files. It does include stat-able files outside the spool directory that are indirectly referenced by files. Sizes are either in bytes or rounded to the nearest Kbyte (1024 bytes), respectively. A totals line is also added at the end of the section. The (meanings) option causes the command to follow and files with a commandline line, instead of subfilenames. For files, one line is printed per remote execution subfile it references. nodename is truncated at seven characters, username at eight, and commandline at how- ever much fits on one line. If is given, for each file with no remote execution files, the command instead shows the meaning of the file itself on one or more lines. Each line consists of a username, then (receive) or (send), then the name of the file to be transferred. See below for details. Filenames are listed in ascending collation order within each section (see Environment Variables below), except that the first section is only sorted by the control filename. Every file in the directory except and appears exactly once in the entire list, unless is used. Details Transaction files are those whose names start with or Subfilenames, which usually start with are gleaned from control file lines, at most one per line, from blank-separated fields, as follows: C.*: R <remotefrom> <localto> <user> -<options> C.*: S <localfrom> <remoteto> <user> -<options> <subfile> <mode> X.*: F <subfile> Lines that do not begin with the appropriate character or are ignored. In the (receive) case, <remotefrom> is used to print the meaning, and its transaction size is taken as zero (unknown). In the (send) case, if <subfile> is <localfrom> is a file not in the spool directory, resulting from a typical call without the (copy) option. In this case <localfrom> is used for the transaction size, if stat-able, and to print the meaning. and both set <subfile> to a true (spooled) subfile name. Orphan files are those whose names start with and which are not referenced by any control files. This algorithm extracts from control files the names of all subfiles that should exist in the spool directory when the transaction is not being actively processed. It is not unusual to see "missing subfiles" and "orphans" if you a spool directory while or is active. Meanings information is obtained by reading each subfile referenced by each file, and by reading files. is taken from the last line in the file which is of the form: U <username> <nodename> Likewise, commandline is taken from the last line of the form: C <commandline> If a subfile name is referenced more than once, references after the first show the subfile as missing. If a subfile name appears in a (corrupt) directory more than once, the name is only found once, but then it is listed again under EXTERNAL INFLUENCES
Environment Variables determines the order in which the output is sorted. If is not specified in the environment or is set to the empty string, the value of is used as a default. If is not specified or is set to the empty string, a default of ``C'' (see lang(5)) is used instead of If any internationalization variable contains an invalid setting, behaves as if all internationalization variables are set to ``C'' (see environ(5)). DIAGNOSTICS
The program writes an appropriate message to standard error if it has any problems dealing with a specified file (directory), including failure to get heap space. It always returns zero as its exit value. If a control file is unopenable (wrong permissions or it disappeared while was running), its name is preceded by a and the size of the transaction is zero. If a subfile is missing (filename not found in the directory being listed) or not stat-able (if required for or its name is preceded by a and it contributes zero bytes to the size of the transaction. If is specified and a file is missing or unreadable, its name is given with a prefixed, as usual. BUGS
This command uses chdir(2) to change to each directory in turn. If more than one is specified, the second through last directories must be absolute (not relative) pathnames, or the may fail. WARNINGS
Use of commands, including is discouraged because they are targeted for removal from HP-UX. Use ftp(1) or rcp(1) instead. AUTHOR
was developed by HP. SEE ALSO
mail(1), uucp(1), uuto(1), uux(1), uuxqt(1M), stat(2). TO BE OBSOLETED uuls(1M)
All times are GMT -4. The time now is 06:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy