Ls command question

I am scratching my head right now. I am trying to archive a ton of files in a directory. I am attempting to tar them by year. On our development server if I type ls *_2008* it returns all of the files I am expecting to see. (The format of the filename includes xx_xx_xxx_2008-09-29_xxx.xxxx.xxxx) When I run the same command on the production server it says file or directory not found. Yet when I do a simple ls I see tons of files that I would expect to come back with the pervious ls command.

Any ideas why it works fine on our development system and does not work on production?

Thanks!

Jeff :confused:

I guess globbing is disabled. Can you enable globbing and retry?

set +o noglob

or

set +f

Nope, that did not change the results of the ls *_2008* command on production.

Thanks for the suggestion anyway!

Jeff

What is your OS and SHELL?

uname
echo $SHELL
$ uname
SunOS
$ echo $SHELL
/bin/ksh
$

It works for me, please verify:

$ uname
SunOS
$ set +f
$ touch /tmp/bla_2008bla_bla
$ echo /tmp/*_2008*
/tmp/bla_2008bla_bla

I am still trying to figure out a way to seperate files by year and place them in individual archive folders.

The weird thing is the "ls *_2008* works in other directories on the server, just doesn't work in this directory. Is there a possibility that there are so many files in this particular directory it is exceeding the buffer when trying to parse the ls command?

Anyone have any other suggestions on how to split up these files by year?

Thanks!

Jeff

If ls *_2008* gives "ls: too many arguments" then try

\ls | grep _2008