Click to See Complete Forum and Search --> : globbing troubles


orpete
03-20-2001, 09:53 PM
Hello,

I'm having globbing troubles.

commands like

ls *.txt return not just the files ending in .txt in the pwd, but in all nested directories too.

less *.txt, which used to let me read each file ending in .txt in a big loop, no longer does anything but display the first file found by the glob pattern.

Does this sound familiar to anyone?

Orpete

fred f
03-21-2001, 02:02 AM
Originally posted by orpete:
Hello,

I'm having globbing troubles.

commands like

ls *.txt return not just the files ending in .txt in the pwd, but in all nested directories too.

less *.txt, which used to let me read each file ending in .txt in a big loop, no longer does anything but display the first file found by the glob pattern.

Does this sound familiar to anyone?

Orpete

sounds like unix (linux) use the -d switch to display directory names rather than contents if you dont want to see contents of directories as a defalult you could set up an alias

in your .bashrc file add the line
alias ls='ls -d'

a better spot might be in the /etc/profile.d/alias.sh which is the master alias list I guess you could say - it affects all users except root

if you want you could put in /root/.bashrc too

as far as less :n will display the next file and :p the previous. the dos version must work a bit differently

did you know that under linux you can use f*s to find a string starting with f and ending with s with an arbitary number of charecters in between?? can be real usefull.
also you can cd abc* (assuming abc* is unique) and change to abcdefg


fred

[ 21 March 2001: Message edited by: fred f ]

[ 25 March 2001: Message edited by: fred f ]