Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Tuesday, 25 August 2026

Running Linux Commands on AS400: A Look at PASE, QSH, and QP2TERM

Here's something that surprises a lot of people new to IBM i: you don't need to leave your AS400 session to run Unix-style commands. Hidden inside IBM i is a genuine Unix runtime environment — and two different doors into it. This post breaks down what PASE actually is, and how QSH and QP2TERM give you two very different ways to use it.

What Is PASE, Really?

PASE stands for Portable Application Solutions Environment. It's an AIX-compatible runtime that's been built into IBM i since V4R4. In plain terms: IBM i has a genuine 64-bit AIX (Unix) runtime living alongside the traditional OS/400 environment, sharing the same machine, same IFS, same job structure — but running Unix binaries and shell commands natively.

This isn't an emulator and it isn't a translation layer bolted on top. PASE processes run as real jobs on IBM i, with access to the Integrated File System (IFS), and can even call back into traditional IBM i programs (RPG, CL, COBOL) and vice versa. That interoperability is what makes it genuinely useful rather than a novelty.

Two Doors Into PASE: QSH vs QP2TERM

This is where people usually get confused, because QSH and QP2TERM feel similar on the surface but serve different purposes.

QSH (Qshell)

Qshell is a POSIX-compliant shell environment that runs on IBM i. You start it by running the QSH command (or STRQSH) from a 5250 command line.

STRQSH

Once inside, you get a Unix-like shell (based on the Korn shell) with access to a large set of Qshell utilities — commands like ls, cp, mv, grep, find, chmod, and more, implemented specifically for IBM i's environment. Qshell is commonly used for:

  • Scripting IFS file operations
  • Running Java-based utilities and JVM apps
  • Text processing (grep, sed-like operations) against IFS files
  • Scheduled batch jobs that need Unix-style scripting logic

Qshell commands are IBM i-native implementations that mimic Unix behavior — they're not the actual AIX binaries. This matters for compatibility: Qshell covers common cases well, but it isn't a full AIX environment.

QP2TERM

QP2TERM is different — it's an actual interactive PASE terminal session. You launch it with:

CALL QP2TERM

This drops you into a genuine AIX shell (ksh) running inside your 5250 session, with access to real PASE/AIX utilities and binaries — not IBM i's Qshell reimplementations. This is the closer-to-"real Linux/Unix" experience of the two.

Inside QP2TERM you can run standard AIX commands, navigate the IFS as a Unix filesystem, and execute PASE-compiled programs (including some open-source tools that have been ported to PASE, like OpenSSH, Python, Node.js, and others via the IBM i Open Source Package Management, formerly known as the "Yum for IBM i" ecosystem).

Quick Comparison

QSH (Qshell) QP2TERM
Command STRQSH CALL QP2TERM
Shell type POSIX shell (IBM i-native implementation) Real AIX Korn shell (ksh)
Commands available Qshell utilities (IBM i reimplementations) Actual PASE/AIX binaries
Best for Scripting, batch jobs, IFS file ops Interactive Unix-style admin work, running ported open-source tools
Feels like A Unix-flavored IBM i shell An actual Unix terminal

Why This Matters If You're Learning Linux

If you're an IBM i admin dipping into Linux, QP2TERM is genuinely useful low-stakes practice ground. You get to run real ls, grep, ps, and other Unix commands, on hardware you already have access to, without spinning up a separate VM. It won't replace learning on a real Linux box — PASE is AIX-flavored Unix, not Linux, and there are behavioral differences — but the muscle memory for command syntax, flags, and piping transfers directly.

It's also worth knowing this exists for the reverse reason: if you ever need to run open-source tooling (OpenSSH, Git, Python, Node.js) on your IBM i system itself, PASE is the mechanism that makes that possible. IBM's Open Source Package Management for IBM i is built on top of this same PASE runtime.

Try It Yourself

If you have access to an IBM i system (pub400.com works fine for this):

CALL QP2TERM

Once inside, try:

pwd
ls -la /home
ps -ef | more

Then exit with:

exit

...which drops you back to your 5250 command line, right where you left off.

An IBM i Admin's Guide to Linux: Terminal Basics

If you've spent years on the green screen — running WRKOBJ, WRKLIB, WRKACTJOB without a second thought — Linux's command line will feel more familiar than you'd expect. It's not a different universe. It's a different dialect of the same language: tell the system exactly what you want, and it does it.

This post kicks off a new series where we translate IBM i / AS/400 concepts into their Linux equivalents. If you already think like a sysadmin, you're closer to "Linux admin" than you think.

The Mental Model Shift

On IBM i, almost everything runs through menus, commands with prompts (F4 is your best friend), and object-based navigation. Linux drops the menus and prompts — you type the full command up front. That's the biggest adjustment: less hand-holding, more precision.

But the underlying logic is the same: you're still navigating a hierarchy of "objects" (files, directories, jobs) and asking the system to list, inspect, move, or act on them.

Core Command Translations

What you want to do IBM i Linux
See what's in a library/directory WRKLIB / WRKOBJ ls
Change current library/directory CHGCURLIB cd
Show current location (implied by session) pwd
Display file contents DSPPFM cat, less, more
Copy a file/object CPYF cp
Move/rename an object RNMOBJ mv
Delete an object DLTF / DLTOBJ rm
Create a directory/library CRTLIB mkdir

A few notes on the mapping:

  • ls is your WRKOBJ. Add flags to get more detail — ls -l gives you a long listing (permissions, owner, size, date), which is roughly the level of detail you'd get from an object's attributes in WRKOBJ with F11.
  • cd has no F4 prompt. You need to know the path already, or use ls first to see where you can go. There's no visual menu — that's the trade-off for speed.
  • Everything is case-sensitive. MyFile.txt and myfile.txt are two different files on Linux. This trips up a lot of IBM i folks at first, since object names are traditionally uppercase and case-insensitive.

Try It Yourself

You don't need to buy anything to practice this — just like pub400.com gives you a free sandbox for AS/400, you have free options for Linux too (I'll cover these in an upcoming video):

  • WSL2 if you're on Windows — a real Linux environment inside Windows, no VM needed
  • A free-tier cloud VM (Oracle Cloud and a few others offer always-free tiers)
  • VirtualBox with a lightweight Ubuntu Server ISO

Once you're in, try this five-minute exercise:

pwd                 # see where you are
ls -l                # list contents with detail
mkdir test_dir       # create a directory
cd test_dir          # move into it
cat > notes.txt      # create a file (Ctrl+D to save and exit)
ls -l                # confirm it's there
cat notes.txt        # view the contents

If that felt intuitive, you're already thinking like a Linux admin — you just need the vocabulary.

What's Next

Next up in this series: File Systems Compared — IFS vs the Linux Filesystem Hierarchy, where we'll map out /QSYS.LIB, /home, and everything in between.

If you're an IBM i person dipping a toe into Linux, drop a comment with what trips you up most — that'll shape where this series goes next.