AIXThis forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
#mv /abc/* /xyz
0403-027 The parameter list is too long
this messages is given when i try to move or copy the cpntent of the directory but
#mv /abc/ /xyz/
this works
but i want to move the contents of /abc directory
If you want to move the contents, then you should go:
Code:
# mv /abc/* /xyz/
The first line you provided doesn't work, because not having a trailing slash ("/xyz" as opposed to "/xyz/") means you are trying to move all of the files in /abc and rename them to /xyz; keep in mind Linux and UNIX have never had a "rename" command - to rename things you "mv" them.
The second line should only give you the desired result if you provide a trailing asterisk "*" from the source - as I provided in my example - so you're moving all of the second-level ("/abc/*" = top level, "/abc/*" = second level) items into the destination directory. Your "mv" command is working.
If you want to move the contents, then you should go:
Code:
# mv /abc/* /xyz/
The first line you provided doesn't work, because not having a trailing slash ("/xyz" as opposed to "/xyz/") means you are trying to move all of the files in /abc and rename them to /xyz; keep in mind Linux and UNIX have never had a "rename" command - to rename things you "mv" them.
The second line should only give you the desired result if you provide a trailing asterisk "*" from the source - as I provided in my example - so you're moving all of the second-level ("/abc/*" = top level, "/abc/*" = second level) items into the destination directory. Your "mv" command is working.
Uhh, nonsense. Doing a 'mv /abc/* /xyz' is fine. The problem is the shell expansion is creating a command line that's too long for his shell (or maybe the mv command).
Try 'for go in /abc/*; do mv $go /xyz; done' assuming you're using ksh or another bourne type shell.
Try 'for go in /abc/*; do mv $go /xyz; done' assuming you're using ksh or another bourne type shell.
This may take ages given the machine has to spawn a new instance of mv for every file (and this will be a lot, given the original error message). find can do this in combination with xargs a lot more quickly, or indeed on its own:
Having the \+ at the end of the find command makes is save a number of input files in a queue, and then batch process them; the alternative (\;) spawns a new instance of rm for each file, which is probably no improvement over the for-loop method.
This may take ages given the machine has to spawn a new instance of mv for every file (and this will be a lot, given the original error message). find can do this in combination with xargs a lot more quickly, or indeed on its own:
Having the \+ at the end of the find command makes is save a number of input files in a queue, and then batch process them; the alternative (\ spawns a new instance of rm for each file, which is probably no improvement over the for-loop method.
Notice that the string "/abc/" is used over and over again. By cd'ing into the directory, you can reduce the arg length because * will then expand into only the contents of the directory:
cd /abc
mv * /xyz
This won't work of course if the expansion of * still exceeds the limit. Then find is easiest.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.