11/07/2026

Top 20 Linux Commands Every SAP Basis Administrator Should Know

Most SAP systems built today run on Linux — SUSE or Red Hat under S/4HANA — which means Basis work increasingly starts at the OS prompt, not inside SAPGUI. These twenty commands cover the five things you'll reach for daily: watching the system, controlling the SAP instance, reading logs, moving files, and checking connectivity.

System and process monitoring

  • ps -ef | grep <sid>adm ‚Äî confirm which SAP work processes are actually running under the instance owner.
  • top ‚Äî live CPU and memory by process; the first stop when a system "feels slow."
  • free -h ‚Äî memory and swap in human-readable units; check swap usage before blaming the application.
  • df -h ‚Äî filesystem usage by mount point; the classic cause of a stuck archive or spool is a full filesystem.
  • du -sh * ‚Äî size up a directory's contents when df says a filesystem is full but you don't know what's eating it.

Controlling the SAP instance from the OS

  • su - <sid>adm ‚Äî switch to the SAP administrator user with its full environment loaded.
  • sapcontrol -nr <NN> -function GetProcessList ‚Äî the OS-level equivalent of SM51, useful when SAPGUI itself won't connect.
  • startsap / stopsap ‚Äî start or stop the instance cleanly instead of killing processes by hand.

Reading logs without opening SAPGUI

  • tail -f dev_w0 ‚Äî follow a work process trace live while reproducing an issue.
  • grep -i error dev_w* ‚Äî scan every work process trace for errors in one pass.
  • less ‚Äî page through a large trace or log file without loading the whole thing into an editor.
  • zgrep / zcat ‚Äî search or view rotated, gzip-compressed logs without decompressing them first.

Finding and moving files

Full walkthroughs of these two live on this blog already — command reference here, details in the linked posts.

  • find /usr/sap/<SID> -name "*.trc" -mtime +30 ‚Äî locate trace files older than 30 days before a cleanup. See The Linux find Command.
  • tar --list --verbose --file archive.tar.gz ‚Äî inspect an archive's contents before extracting it. See The TAR command | Bash Basics.
  • scp file.tar.gz user@host:/path/ ‚Äî copy a file securely between SAP hosts.

Networking and connectivity checks

  • ping <host> ‚Äî confirm basic reachability before chasing an RFC error.
  • telnet <host> <port> (or nc -zv <host> <port>) ‚Äî check whether a specific port is actually open; this catches firewall issues telnet-to-host alone misses.
  • ss -tulpn ‚Äî list listening ports and the process holding each one; the modern replacement for netstat.

Editors, permissions, and the rest

  • vi / vim ‚Äî unavoidable for editing config on a server with no GUI. See VI Shortcuts & Commands For Newbies and How to Exit From VIM (VI)? if :wq isn't yet muscle memory.
  • sudo <command> ‚Äî run a single command with elevated rights without logging in as root. See Linux Commands For Beginners: SUDO.
  • chmod / chown ‚Äî fix file permission and ownership issues, a common cause of a work process failing to write its own trace file.
  • crontab -l ‚Äî check what's scheduled on the OS level, separate from SAP's own job scheduler.

Quick reference

CommandUse it for
ps -ef | grep sidadmConfirm SAP work processes are running
top / free -hCPU, memory, swap at a glance
df -h / du -shFilesystem space and what's using it
sapcontrol -function GetProcessListSM51 from the OS prompt
tail -f / grep / less / zgrepReading and searching logs
find / tar / scpLocating, archiving, and moving files
ping / nc -zv / ss -tulpnConnectivity and port checks
vi / sudo / chmod / chownEditing config and fixing permissions

FAQ

Do SAP Basis administrators need to know Linux?

Yes — most current SAP installations, especially S/4HANA, run on SUSE or Red Hat Enterprise Linux. SAPGUI covers application-level administration, but instance control, log review, and OS-level troubleshooting all happen at the Linux command line.

What command switches to the SAP administrator user?

su - <sid>adm switches to the SAP system's administrator account with its environment (paths, SAP-specific variables) loaded, which plain su <sid>adm without the dash does not do.

How do I check if SAP work processes are running from the OS?

Run ps -ef | grep <sid>adm to see the raw OS processes, or sapcontrol -nr <NN> -function GetProcessList for the same view SM51 shows inside SAPGUI.

No comments:

Post a Comment

Popular Posts