QSHELL (or QSH
) is a command-line shell on IBM i (AS/400) that allows you to execute Unix-like commands. It provides a POSIX-compliant environment and is often used to interact with the IFS (Integrated File System), run scripts, or use tools like SSH, SCP, etc.
✅ How to Start QSH
-
To start an interactive QSH session:
QSH
-
To run a single command from the IBM i command line:
QSH CMD('your_unix_command')
📁 Common Examples
List contents of a directory:
QSH CMD('ls /home/user')
Copy a file:
QSH CMD('cp /home/user/file.txt /home/user/file_copy.txt')
Delete a file:
QSH CMD('rm /home/user/file.txt')
Read (display) a file:
QSH CMD('cat /home/user/file.txt')
Redirect output to a file:
QSH CMD('ls /home/user > /home/user/filelist.txt')
⚠️ Notes
-
Case-sensitive: Commands and paths are case-sensitive.
-
File system: It operates within the IFS, not traditional libraries like
QSYS.LIB
. -
Environment: Not all Unix tools are available unless specific options (like PASE) are installed.