Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with ls command 1

Status
Not open for further replies.

KMG

Programmer
Nov 29, 2002
5
GB
Hi,

I have a problem retrieving correct information via the ls command on our AIX system.

For example, the file I'm looking for is called fred.c and if I execute ls -l f* I can see the file along with other f* files. However, if I issue ls -l fr*, I get an error stating fred.c cannot be found.

I suspected that the filename I'm after contains rogue characters, so I piped the command through 'tr' to delete any non printable characters from the file name but this doesn't appear to work either.

Can anyone suggest a solution to this problem, please ?

Thanks
 
ls -b List nonprinting characters in the octal \ddd notation.
 
Thanks Ygor: unfortunately the ls -b command didn't give me any more information :(

Have a star anyway because that was a useful tip which I hadn't thought of! Cheers!
 
what does it look like if you:
ls -l fred.c

or
ls -l 'fr*'

which shell are you using by the way?
 
Thanks folks forthe replies. The answer is quite embarrassing really but I'm not proud :)

The problem is that there was a directory called 'fstuff' and so 'ls -l f*' command returned the contents of this but didn't indicate it in the output :( Very confusing..... So ls -l fr* would fail every time unless I had issued 'cd fred'

BTW: I was using ksh on and AIX 5.1 box

Thanks again.
 
I'm sorry, the Data Protection Act here prevents me from providing a listing, hence the use of pseudo filename, 'fred.c'.

Thanks for the ls -lR tip.

Re 'And view this page:'

I'm sorry, was my question inappropriately phrased?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top