- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: ls buffer size hp-ux 10.20
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
06-09-2006 07:50 AM
06-09-2006 07:50 AM
fixes the buffer size when listing lots of
files?
/bin/ls: Arg list too long.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2006 07:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2006 07:56 AM
06-09-2006 07:56 AM
Re: ls buffer size hp-ux 10.20
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2006 08:09 AM
06-09-2006 08:09 AM
Re: ls buffer size hp-ux 10.20
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2006 08:15 AM
06-09-2006 08:15 AM
Re: ls buffer size hp-ux 10.20
As noted above, "find" is your friend here.
First ran across this when porting from Data General UX (5 maybe) to HP-UX 9. DG had 2meg ARG_MAX and HP had the 5K(?). Custom app had 1800+ source files, some w/ very long names......it was ugly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2006 08:41 AM
06-09-2006 08:41 AM
Re: ls buffer size hp-ux 10.20
the kernel parameters affects the commands.
for example, "create_fastlinks" MAY affect the ln or ln -s commands.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2006 08:28 AM
06-10-2006 08:28 AM
Re: ls buffer size hp-ux 10.20
ls /dir_with_10k_files/*
ls *NEVER* sees the "*". That character is preprocessed by the shell. It is replaced with all the filenames that match the *. Let's suppose there are 2 files named AB1 and AB2 and you want to use ls:
ls /dir_with_10k_files/AB*
You'll see the two files listed even though there are 10,000 files in the directory. What was passed to ls were the full pathnames of the 2 files. To better see this, use echo instead:
echo /dir_with_10k_files/AB*
Now try the same echo with all the files:
echo /dir_with_10k_files/*
and you'll see "arg list too long"
The shell only has a small buffer to expand the names. It used to be about 20k bytes and with a patch was increased to a couple of megs. NOTE: the buffer can never be made large enough! No matter how big the next patch might be, someone will create a massively large directory that will still exceed the latest buffer size and cause a problem.
So there are two steps:
First, do whatever you can to stop allowing massively large flat filesystems (directories with thousands of files). You are just beginning to se some of the difficulties in managing hundreds or thousands of files in one directory.
Second, start looking at xargs to filter long lists. xargs is like a small truck -- it picks up long lists and sends them out in small bundles.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2006 01:22 AM
06-11-2006 01:22 AM
Re: ls buffer size hp-ux 10.20
The file /usr/include/sys/param.h defines the variable NCARGS, which defines the size for the argument list. There is no way to change this value, because the OS has been compiled based on the current header file.
Due to a limitation in the OS, you only have two options at this point:
1. Break your ls search into smaller cross-sections.
2. Try an alternative searching method.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2006 09:53 AM
06-12-2006 09:53 AM
Re: ls buffer size hp-ux 10.20
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2006 01:44 AM
06-13-2006 01:44 AM
Re: ls buffer size hp-ux 10.20
# ls * |wc -l
2966
# touch onemore
# ls *
ksh: /usr/bin/ls: arg list too long
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2006 01:53 AM
06-13-2006 01:53 AM
Re: ls buffer size hp-ux 10.20
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2006 02:12 AM
06-13-2006 02:12 AM
Re: ls buffer size hp-ux 10.20
If you examine the patch notes for PHKL_16751 for 10.20 you will note:
/* begin_quote */
When this patch is installed the default environment size is 20478 bytes. To enable the system to use the larger environment size of 2048000 bytes, the following steps must be followed.
1. A new tunable called 'large_ncargs_enabled' must be defined in the sytem file in the following manner
large_ncargs_enabled 1
2. A new kernel must be built (using this system file) and the system rebooted.
/ *end_quote */
You can find the 10.x patch archive from here:
http://www1.itrc.hp.com/service/patch/mainPage.do
You can see the current value of ARG_MAX thusly:
# getconf ARG_MAX
Regards!
...JRF...