- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- starnge behaviour of ls command
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
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
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
тАО01-20-2006 04:59 AM
тАО01-20-2006 04:59 AM
I've a rather big directory in which if I do a command like, ls or ls -al, everything will work fine, I'll get my listing. BUt if I do something like
# ls df* or ls *.lis will give no listing and get only a
/usr/bin/ls : Arg list too long message
There are plenty of file called df01.lis in that directory, so I expected something to come out!
Any idea on what could be wrong?
Thanks very much,
Percy Glaves
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-20-2006 05:02 AM
тАО01-20-2006 05:02 AM
SolutionDo this instead:
cd /yourdatadirectory
find . -name "df*" -o -name "*.lis" | xargs -i ls -al {} > /tmp/dirlisting.out
Oh, and btw, if possible it's time to clean some files from that directory!
:-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-20-2006 05:04 AM
тАО01-20-2006 05:04 AM
Re: starnge behaviour of ls command
You can look at this thread
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=501693
Rgds
HGN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-20-2006 05:06 AM
тАО01-20-2006 05:06 AM
Re: starnge behaviour of ls command
This is quite expected.
The shell is expanding all filenames that match the characters before the asterisk ("*") and *then* passing (or trying to pass) that argument list to the 'ls' command. Thus, you do:
# ls w*
(for example)
...but the shell really expands this to look like:
# ls what whence where whether why ...
...or whatever files exist in the directory in which you are running.
This can lead to an argument-list-too-long error. There is nothing wrong other than you must divide and conquer by reducing the length of the list. In this case, that could be as simple as adding a few more characters to match before the asterisk.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-20-2006 05:25 AM
тАО01-20-2006 05:25 AM
Re: starnge behaviour of ls command
Thanks very much