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.
User avatar

Topic author
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

Postby demecarv » Fri Sep 18, 2015 3:16 am

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: 544
Joined: Wed Apr 23, 2014 8:45 pm
Been thanked: 11 times

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

Postby nicc » Fri Sep 18, 2015 4:04 am

What does "not working" mean i.e. what messages are displayed?


Regards
Nic

Online
User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1275
Joined: Fri Jun 28, 2013 1:22 am
Location: East Dubuque Illinois
Has thanked: 2 times
Been thanked: 90 times

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

Postby Robert Sample » Fri Sep 18, 2015 6:21 am

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

Topic author
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

Postby demecarv » Sat Sep 19, 2015 2:40 am

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?




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

Who is online

Users browsing this forum: CommonCrawl [Bot] and 0 guests