A Unix Survival Guide for the ISPF Veteran Moving Off Endevor (Part 2: More Commands)

Part 1 covered the concepts — how a PDS maps to a directory, how Endevor’s package-and-promote model maps to Git’s commit-and-merge model, and the handful of commands you need to get moving: lscdvigitchmod. This installment adds the commands you’ll reach for once you’re doing real work day to day: searching across files, checking space, watching processes, and moving data around.

Every command below is confirmed against IBM’s z/OS UNIX System Services Command Reference — this is the z/OS shell (available through TSO OMVS, SSH, or batch via BPXBATCH), not a generic Linux box, and the two don’t have identical toolsets. We’d rather point you at what’s actually there than have you type something that works everywhere except where you’re standing.

Finding things: find and grep

In ISPF you had member lists and the 3.14 or SUPERC-style search across a dataset. Unix splits that into two jobs.

find locates files by name, type, or other attributes, walking a directory tree the way you’d once have scanned a dataset list:

find . -name "*.sh"

grep searches file contents for a pattern — the direct equivalent of an ISPF FIND across members, but usable across an entire directory tree at once:

grep -r "DSNAME" /u/yourid/scripts

egrep and fgrep are variants of grep — egrep supports extended regular expressions, fgrep treats the search string as a literal, fixed pattern rather than a regular expression. All three are standard z/OS shell commands.

Editing beyond vioedit and obrowse

If vi doesn’t feel like home yet, z/OS UNIX also gives you oedit and obrowse — an ISPF-style edit and browse experience for files in the Unix file system, callable from TSO. If you want a bridge between the two worlds while you build up vifluency, we recommend starting there rather than forcing vi on day one.

Text processing: sedawksortcutwc

These are the workhorses of shell scripting — the equivalent of the utility programs you’d have invoked in a JCL step (ICETOOL, SORT, or a bespoke COBOL filter), but callable inline and chainable with pipes.

  • sed — a stream editor for find-and-replace and line-based edits: sed 's/OLDVAL/NEWVAL/' file.txt
  • awk — pattern scanning and field-based processing, useful for pulling columns out of structured text
  • sort — sorts lines of text, the shell equivalent of a SORT step
  • cut — extracts specific fields or columns from each line
  • wc — counts lines, words, and bytes (wc -l for a quick record count)

The habit worth building: chain small commands together with the pipe (|) instead of writing one large script. grep ERROR logfile.txt | wc -l counts error lines in one line, the way you might once have chained SORT and ICETOOL steps to get the same answer.

Checking space and files: dfdufile

  • df shows free space in a mounted file system, the rough equivalent of checking a volume’s free space in ISPF 3.4
  • du summarizes how much space a directory or file tree is using — handy before you assume a git clone will fit where you think it will
  • file tells you what kind of file you’re looking at when the extension doesn’t say, useful when you inherit someone else’s repo

Watching and controlling work: pskillnohup

  • ps shows running processes — your equivalent of checking active jobs, though scoped to the Unix side rather than JES
  • kill ends a process or sends it a signal, the shell’s version of cancelling a job
  • nohup starts a process that keeps running even after you log off, useful for anything long-running you kick off from an SSH session you don’t want to babysit

Moving and archiving files: tarpaxcpio

Where you might once have used IEBCOPY or IEBGENER to move a member or a whole dataset around, Unix gives you archive utilities that bundle a directory tree into a single file:

  • tar — the most common, used for packaging a set of files (tar -cvf archive.tar directory/ to create, tar -xvf archive.tar to extract)
  • pax — a portable archive interchange utility, IBM’s preferred tool in some z/OS contexts for moving data between the Unix file system and MVS datasets
  • cpio — an older archive format, less common now but still standard

Getting help without leaving the shell: man

man commandname prints the reference page for a command — the shell’s equivalent of pulling up the ISPF help panel for a command you half-remember. It’s there and it’s reliable; we recommend making it your first move before searching the web for syntax you can get faster locally.

A word of caution on assumptions

Not everything a Linux tutorial shows you exists on z/OS out of the box. Utilities like toplesscurl, and wget are common on Linux distributions but are not part of the base z/OS UNIX System Services shell command set — some may be available through separately installed packages (like the z/OS Open Tools or IBM Open Enterprise SDK offerings) depending on how your shop has configured USS, but you shouldn’t assume they’re there. If a script you’re adapting calls a command and you’re not sure it exists on your system, check with man commandname or whence commandname before you build a dependency on it.

Where to go from here

Take one recurring task you used to do in ISPF — searching a set of members for a string, checking how much space a dataset group is using, or bundling files for transfer — and do it once with these commands. That’s the fastest way to convert “I read about this” into “I know this.”

Next in this series: Part 3 covers gitcurlvim, and the rest of the tools that don’t ship in base z/OS UNIX System Services but are available at no cost through IBM Open Enterprise Foundation for z/OS — the gap this part flagged with toplesscurl, and wget.

Leave a Comment