- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Maximum number of files using tar
Operating System - HP-UX
1823057
Members
3074
Online
109645
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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-29-2001 01:05 PM
тАО06-29-2001 01:05 PM
What is the maximum number of files I can tar at once? I have a directory with several thousand 1-line files that I would like to tar into one file. I attempt to do: tar cf tarfile.tar * and the error I get is ksh: /usr/bin/tar: arg list too long. I've also tried: tar cf tarfile.tar a* (to get all files starting with "a"), and receive the same error. Anyone know the most I can tar at once?
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2001 01:09 PM
тАО06-29-2001 01:09 PM
Solution
Hi Sara,
You are asking the wrong question. It is not a tar limit but rather a limit of the shell. The '*' is expanding to exceed argmax. All you need to do is:
cd to desired directory
tar cf /tmp/tarfile.tar .
That will get all the files in the directory.
Clay
You are asking the wrong question. It is not a tar limit but rather a limit of the shell. The '*' is expanding to exceed argmax. All you need to do is:
cd to desired directory
tar cf /tmp/tarfile.tar .
That will get all the files in the directory.
Clay
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2001 02:59 PM
тАО06-29-2001 02:59 PM
Re: Maximum number of files using tar
This is an important note about massively flat directories (ie, thousands of files in a single directory). The ls/ll commands will really slow down the system and any attempt to manipulate them with regular expressions (like mv *) will get the same error.
The reason is that the shell first processes the * character, then replaces it with the result on the command line--which is not unlimited in size. There is a patch that extends the maximum command line but it still isn't infinite, so:
1. Redesign the directory for a hierachy so there are only a few dozen files at each level or,
2. become very familiar with find and -exec, and also learn about xargs. You'll need it.
Bill Hassell, sysadmin
The reason is that the shell first processes the * character, then replaces it with the result on the command line--which is not unlimited in size. There is a patch that extends the maximum command line but it still isn't infinite, so:
1. Redesign the directory for a hierachy so there are only a few dozen files at each level or,
2. become very familiar with find and -exec, and also learn about xargs. You'll need it.
Bill Hassell, sysadmin
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP