Skip to content
masterclass Buddy

Linux & Shell · Environment Variable

PATH

The exec family replaces the current process image with another program. Different forms choose how to pass arguments, the environment, and whether to search PATH.

Last updated

Since
execvpe(): glibc 2.11

Syntax

#include <unistd.h>
extern char **environ;
int execl(const char *path, const char *arg, ... /*, (char *) NULL */);
int execlp(const char *file, const char *arg, ... /*, (char *) NULL */);
int execle(const char *path, const char *arg, ... /*, (char *) NULL, char *const envp[] */);
int execv(const char *path, char *const argv[]);
int execvp(const char *file, char *const argv[]);
int execvpe(const char *file, char *const argv[], char *const envp[]);

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • execve(2)
  • execveat(2)
  • fork(2)
  • fexecve(3)
  • system(3)
  • environ(7)

Source: exec(3) - Linux manual page. Checked 2026-11-03.