In the past, people advocated against using ls that way, which I found curious. The difference in processing power is completely insignificant.
Quote:
Originally Posted by Scrutinizer
For mixed case extensions and file names that may contain spaces:
But I just now tried that way and Scrutinizer's way and was surprised to find that simple wildcard expansion does work with filenames that have spaces in them, whereas using ls does not.
That's excellent to know, because I sometimes encounter filenames with spaces. So I always try to make all my scripts work seamlessly with them.
i have a set of *.lst files. now i want to change the names from "lst" to "dat". how to do it?
ex.:
-rw-r--r-- 1 rram group 22 Sep 21 13:10 a.lst
-rw-r--r-- 1 rram group 22 Sep 21 13:09 b.lst
-rw-r--r-- 1 rram group 22 Sep 21 13:10 c.lst... (4 Replies)
Hi All,
Today I got a small problem while handling zipped files in PROD support.
There are files in this format and I had to grep them reading some contents
A.B.gz.C.D
where A,B,C and D stand for variables (like FIRST.NAME.gz.MIDDLE.LAST).
I know that these files are zipped files and If I... (1 Reply)
Hi All
We have hp-ux 11iv1 system running with oracle8i database.
We have around 350,000 users, each user uploaded their own signatures and are stored in unix filesystems department wise.
A database is maintained to keep their particulars with a path to link their signature files.
Now... (3 Replies)
Hi Alll,
I have a script that we use on the servers to change the name of files that have spaces in the name:
#!/bin/tcsh
set n = 0
foreach f ( * )
echo $f | grep " "
if ( $? == 0 ) then
mv "$f" `echo $f | sed -e "s/ /_/g"`
@ n += 1
endif
end
echo $n changed
I need to write a... (2 Replies)
Hi all,
using a utility image file was named starting with blank space and a blank space in between. I want to rename the files.
file names are in the format " sb 12.tif"," sb 13.tif"," sb 14.tif" the files are in thousands. i want to rename as 12.tif, 13.tif, 14.tif....
thanks. (3 Replies)
Hi All
I have a folder that contains hundreds of file with a names
3.msa
4.msa
21.msa
6.msa
345.msa
456.msa
98.msa
...
...
...
I need rename each of this file by adding "core_" in the begiining of each file such as
core_3.msa
core_4.msa
core_21.msa (4 Replies)
hi guys and girls,
i have a folder containing RAW and JPG images. eg...
001.jpg
003.jpg
005.jpg
001.raw
002.raw
003.raw
004.raw
005.raw
I want to copy only RAW files that have a corresponding JPG file in to a new folder. the jpg files do not need to be copied.
in this example i... (6 Replies)
Hi
i have to achieve the following
i have files as xyz001.csv, xyz002.csv.......xyz0025.csv in a folder, i need to keep xyz001.csv as it is
but want to remove the extra zero on filename from 10 say
xyz0010 should be renamed to xyz010
xyz0025 should be renamed as xyz025
Note xyz... (8 Replies)
Hi,
In sftp script to get files, I have to rename all the files which I am picking. Rename command does not work here. Is there any way to do this?
I am using #!/bin/ksh
For eg: sftp user@host <<EOF
cd /path
get *.txt
rename *.txt *.txt.done
... (7 Replies)