How to move/copy files from one directory to other via ishell or OMVS

Linux on System z, Linux on zSeries, Linux/390, zLinux, z/Linux, z/VM & UNIX Shell services. IBM OS/360, OS/370, MVS, OS/390, TPF, VM/CMS, VM/ESA, VSE/ESA, z/VSE, z/OS.
Post Reply
User avatar
demecarv
Registered Member
Posts: 52
Joined: Sat Sep 12, 2015 2:03 am

How to move/copy files from one directory to other via ishell or OMVS

Post by demecarv »

As a very beginner in Mainframe, I have to move certain files from usr/MyCompany/MyApp/parentFolder/innerFolder to usr/MyCompany/MyApp/parentFolder/, just move files to one level up in the directory tree. Firstly, I though it was going to be quite easy, just by chosing "ISPF Primary Option Menu", 6 Commands (Enter TSO or Workstation commands), open either a shell via ish command or MVS prompt via OMVS command and type cp usr/MyCompany/MyApp/parentFolder/innerFolder usr/MyCompany/MyApp/parentFolder/. Unfortunately, although the command from Unix/Linux perspective is correct it is not working probably because I missed some steps related to mainframe. Other tentative I tried was by browsing the directory and type c on left side. I could see the message copied but I don't know how paste it in other directory. I am sure I am close to do it but I probably miss one extra step. Could someone point me that?
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: How to move/copy files from one directory to other via ishell or OMVS

Post by nicc »

What does "not working" mean i.e. what messages are displayed?
Regards
Nic
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1891
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: How to move/copy files from one directory to other via ishell or OMVS

Post by Robert Sample »

Have you looked up the cp command in the Unix System Services Command Reference manual? When I did, I found a statement that Unix directory to Unix directory copies (such as what you attempted) are NOT allowed unless the -R or -r option is specified. If there are sub-directories involved, use the -R option. Otherwise, I would use

Code: Select all

cp usr/MyCompany/MyApp/parentFolder/innerFolder/* usr/MyCompany/MyApp/parentFolder/
since the asterisk indicates you are not copying directory to directory, but files to a directory. I have not tested this to verify it works, but I've done hundreds of Unix copies (files to files, files to directories, wildcarded files to directories and so forth) and IIRC that's the way I usually copy files.
User avatar
demecarv
Registered Member
Posts: 52
Joined: Sat Sep 12, 2015 2:03 am

Re: How to move/copy files from one directory to other via ishell or OMVS

Post by demecarv »

I understand that there are several ways to copy/rename/delete/move files in mainframe.
By opening either (1) ishel or (2) omvs console will accept Unix/Linux commands. By using omvs, after Robert commented above, I am able to copy it (I was missing -R). But I am still unable to do the same via ishel. In ISPF Command Shell, I type ish. Then, in Unix System Services ISPF Shell, I write the exact same command used succesfuly in omvs but I get this answer "Errno=81x No such file or directory exists; Reason=0594003D...". Only as a try, I type cd /usr and same answer. Wouldn't ishel allow me the same unix command?
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “zLinux, USS and other Operating Systems for Mainframes.”