Do you mean that you want to read the file's content rather than just the name?
Perhaps this might help:
Does that help, or have I missed the point? It would help if you can explain a little more, preferably with the output you are getting, sample data from your file and the desired output. Please wrap all code, files, input & output/errors in CODE tags. Highlight the text required and press the button on the toolbar which has co over de. You can check and adjust it by pressing the Go Advanced button below.
Okay, that is possible. I'm assuming that the filename contains the date & time in a sorted format, do these are 1st April and 1st May. Does this help:-
An alternate might be:-
You can argue that the first one spawns another few processes to run the ls & the tail so might be slower, but it's obviously more compact. I suppose it depends on the size of the list. It is probably negligible in most cases. If you are going to reprocess a large list, then it would probably be better to store it rather than to keep re-reading it.
Does that help?
Do you want the output to the screen (STDOUT) another file, or to update the file?
Okay, that is possible. I'm assuming that the filename contains the date & time in a sorted format, do these are 1st April and 1st May. Does this help:-
ls has a reverse option, of course, allowing one to ues head:
This may be quicker if you have a large number of files.
Hi All,
I have a AIX file system with a folder structure like this
/1
/1/2
/1/2/3/5
/1/2/3/2
/2
/2/3/4
/2/5/6
I would like to list subdirectories
/1/2/3/5
/1/2/3/2
/2/3/4
/2/5/6
Can you please help me with this issue. (6 Replies)
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)
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)
how would i list all files, directories and exectable files in my directory?
is there anyway to find out what date a file was created?
Thanks!! (2 Replies)
Hi there!
I would like to list all the files from a directory and its subdirectories. For example:
DIRECTORY
|- SUBDIR1
||- sub1.txt
||- sub2.txt
|- SUBDIR2
||- sub3.txt
|- root1.txt
|- root2.txt
I would like to create a fulllist.txt file which contains the list of these files (with... (2 Replies)
How can I list all files in a directory and its subdirectories that have been created or changed since the system was booted. I was trying to acomplish this with "ls" and "find" commands but could not get anything usefull. Maybe some one can provide me a hint.
Thank you for your time. (1 Reply)
Hi
I have 2 questions:
Q1 - What does
${1:+$1/}*
mean? I guess it lists all files in current directory - Could any one explain how this expression works?
Q2 - I am trying to list directories only in current path - I know that ls could be used but I thought I'd give find a try. I need to... (5 Replies)
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)