But there is one problem, the output is in the form
I would also like to have the file size information along with it. It is important for me. For example like this
I do not worry about the rest information about the date and all.
I don't understand. If you want to sort by filename why do you use -rt option (sorted by reverse time) and not a simple :
or if you want only size + filename :
Thanks for the reply, it worked fine.
But I just realized that it is not the end of my trouble. Actually, there are some 10k such files with double counting of some files. For example in the code above, it is "vgtree_518*.root" and "vgtree_517*root".
Now, what I need to do is to select such double (or triple) occurring files and delete the one having smaller file size. And would like to keep the one with the big file size.
Here in the code, I would like to keep any of the above 2 files as they have same file size and would like to delete the rest two.
I am not sure if it is doable using script. else, I will have to do it manually,
What worked fine? You were provided with multiple suggestions. Since you are seeking further refinements, knowing exactly what code you're currently using will save time.
Also, it always helps to know the operating system and shell being used.
Hi there,
How can I loop through files with order.
I tried using ls .html | sort -v
However the filename is with spaces:1233.61.47.0 - 121.61.123.112 nexpose.html
Here is the original code that is working well, but I need to sort through the filename.echo "<center>"
for file in *.html... (2 Replies)
Hi,
I need to list files in ascending order. Filenames are in format inpTDT_1, inpTDT_2, inpTDT_3 and so on.
I want to list them in the ascending order based on the digit after underscore and send the output to a file.
Please help (5 Replies)
Hi
I have a requirement like below
I need to sort the files based on the timestamp in the file name and run them in sorted order and then archive all the files which are one day old to temp directory
My files looks like this
PGABOLTXML1D_201108121235.xml... (1 Reply)
Hello Friends,
I want to merge two files in ascending order on the first field. And if the first field matches sort on 3rd field i.e, TXADDR should come ahead of RXADDR .
file1
9 : TXADDR : 00000000
65 : TXDATA 0000000000000011
83 : TXDATA 0000000000000012
453 :... (10 Replies)
Hi all,
This is program to identify and arrange programs(scripts) based on their she-bang values to a folder with the same name.
The parts of mkdir and copy and creating problems.I also doubt the use of hash...maybe some problems in it.
Please help out debugging this.
Code pasted at:
Paste... (2 Replies)
Hi,
I have two master files which contain the information for many jobs like this
Job no:1 a b c d
Job no:1 d e g h
Job no:2 t j s h
Job no:2 t j s h
I have written a script to pick up all the information for Job no:1 from file1 and put that to a temporary file and do the same from... (2 Replies)
Im on HP/UX and am trying to find the command like an ll but that will sort showing the most currently modified programs first.
Can anyone help me with that? :cool: (2 Replies)
Hi, I'm trying to write a ksh script to copy a specified number of files from one directory to another.
The files are named in the convention <switchname>_log.<num> and the numbers are sequential single digit onwards. I figured I could find some parameter for ls which would list the files in... (3 Replies)
I have a shell script that is looping through a list of Postscript files to print.
ls -1tr *.PS > print.lst
...
PRINT_LIST=`cat print.lst`
...
for DMFILE in $PRINT_LIST
do
lp -d $PRINTER_NAME -o legal $DMFILE
...
done
The files in print.lst are in the order that they should be... (2 Replies)