- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Problems with ls
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2004 09:58 PM
02-01-2004 09:58 PM
I have a listing of files in a directory. When I use ls to list the files, the list appears as output.
However, when I try to ls an INDIVIDUAL file the file is not recognised. This applies to the cat , file commands also.
Can anyone help ?
Cheers
Jeff
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2004 10:00 PM
02-01-2004 10:00 PM
Re: Problems with ls
when you mean not found, try ls -lb to see any invisable characters in the name.
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2004 10:03 PM
02-01-2004 10:03 PM
Re: Problems with ls
When I do that I get the following :-
root@telesto[dublin_out1] ls -lb SNNL54020700_20040202_072325
SNNL54020700_20040202_072325 not found
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2004 10:12 PM
02-01-2004 10:12 PM
Re: Problems with ls
just do a ls -lb without files as parameter
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2004 10:14 PM
02-01-2004 10:14 PM
Re: Problems with ls
Yes as I say I can do an ls -lb in the directory to get a list of files but cannot do an ls -lb on an individual file.
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2004 10:18 PM
02-01-2004 10:18 PM
Re: Problems with ls
What happens when you use ls -lb on the dir? does it show your SNNLwhatever filename with any extra characters?
Does ls -lb *SNNL54020700_20040202_072325* work?
regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2004 10:19 PM
02-01-2004 10:19 PM
Re: Problems with ls
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2004 10:22 PM
02-01-2004 10:22 PM
Re: Problems with ls
As you see the reply to your question is yes - as below :-
ls -lb *SNNL54020700_20040202_072325*
-rw-r--r-- 1 root sys 115 Feb 2 07:23 SNNL54020700_20040202_072325
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2004 10:24 PM
02-01-2004 10:24 PM
Re: Problems with ls
regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2004 10:25 PM
02-01-2004 10:25 PM
Re: Problems with ls
It sounds to me as if your files have some hidden chartacters included in the filenames.
Try doing something like
ls -l S* to see if the files are listed; then
ls -l SN*
ls -l SNN*
etc etc to try to establish where the hidden characters are.
Hope this helps you in some way,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2004 10:26 PM
02-01-2004 10:26 PM
Solutionls | awk -Feol '{ printf "|%s|\n",$1 }'
output will be like:
|scripts|
|t|
|tmp |
The tmp file has space behind the filename.
Hopes this helps you to figure out what the problem is.
Regards,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2004 10:32 PM
02-01-2004 10:32 PM
Re: Problems with ls
I get the following :-
root@telesto[dublin_out1] ls | awk -Feol '{ printf "|%s|\n",$1 }' | more
|SIGR21010300_20040201_031111 |
|SIGR21010300_20040201_031139 |
|SIGR21010300_20040201_034926 |
|SIGR21010900_20040201_091011 |
|SIGR21010900_20040201_091100 |
|SIGR21010900_20040201_093457 |
|SIGR21011500_20040201_151004 |
|SIGR21011500_20040201_151129 |
|SIGR21011500_20040201_152144 |
|SIGR21012100_20040201_211001 |
|SIGR21012100_20040201_211138 |
|SIGR21012100_20040201_211836 |
|SIGR21012100_20040201_212920 |
|SIGR21020300_20040202_031010 |
|SIGR21020300_20040202_033906 |
|SIGR21020900_20040202_091051 |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2004 10:33 PM
02-01-2004 10:33 PM
Re: Problems with ls
ls *SNNL54020700_20040202_072325* | od -x
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2004 10:36 PM
02-01-2004 10:36 PM
Re: Problems with ls
It looks like you have 1 or multiple spaces(forum removes the multiples) behind each filename.
use the * behind the filename in your cat command to view the file (or reuse the awk from the ls)
Regards,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2004 10:45 PM
02-01-2004 10:45 PM
Re: Problems with ls
Thanks for your replies.
We have discovered multiple white spaces after the file name.
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2004 07:24 AM
02-03-2004 07:24 AM
Re: Problems with ls
To see a file:
ls | cat -vet (shows non-printing characters, tabs and form-feeds visibly, with a $ as the end of line marker.)
To work with a file:
ls -i ( to get the inum ) and then
find -inum xxx -exec somecommand {} \;