x
Loading
 Loading
Hello, Guest | Login | Register

Execution and Redirection

While the title of this month’s “Power Tools” is “Execution and Redirection,” it’s not about about dying and going to heaven. Instead, controlling execution and redirecting input and output is an important part of managing Linux processes.

While the title of this month’s “Power Tools” is “Execution and Redirection,” it’s not about about dying and going to heaven. Instead, controlling execution and redirecting input and output is an important part of managing Linux processes.

Let’s dig into these two topics, learn the basics, and then see some shell features for managing processes that are little-known, but indispensable nonetheless.

Life as a Process

When Linux runs a program, it “spawns,” or starts, a new process to keep track of the program’s state, including the program’s current directory, environment variables, open files, and more. A process identification number, or PID, uniquely identifies each process, and each process (except for the special seed process named init) also has a parent process ID, or PPID, that refers to the process that spawned it. (A new process is often referred to as a “child,” which makes the process that spawned it a “parent.”)

You can examine processes with the ps (process status) utility. With no arguments, ps prints a list of “useful” processes, which may or may not show the process you want. You can expand or refine the list of processes with a number of ps options (see its man page), or you can look at a specific process just by specifying its PID, using ps PID or ps -p PID.

For example, your shell is just another program (albeit a complicated one), and a shell running in an xterm window is just…

Please log in to view this content.

Not Yet a Member?

Register with LinuxMagazine.com and get free access to the entire archive, including:

  • Hands-on Content
  • White Papers
  • Community Features
  • And more.
Already a Member?
Log in!
Username

Password

Remember me

Forgotten your password?
Forgotten your username?
Read More
  1. KDE 4.4: Does It Work Yet?
  2. Writing Custom Nagios Plugins with Python
  3. Power Up Linux GUI Apps
  4. Tweeting from the Command Line with Twyt
  5. When Memory Serves You: Using ramfs and tmpfs
Follow Linux Magazine
Rackspace