← All commands
Topic hub Terminal & Shell Scripting
Windows Linux Terminal & Shell Scripting Expanded guide Terminal

Windows path equivalent in Linux

Shows or modifies the list of directories the shell searches when you type a command.

Windows path
→
Linux equivalents
Debian/Ubuntu same command
echo $PATH / export PATH
Fedora same command
echo $PATH / export PATH
Arch same command
echo $PATH / export PATH

Overview

What this command does

On Windows, "path" is used to view or modify the command search path. On Linux, the closest practical mapping shown here is "echo $PATH / export PATH". Shows or modifies the list of directories the shell searches when you type a command. This reference is grouped under Terminal & Shell Scripting → Terminal.

Migration tip: PATH directories are colon-separated in Linux (not semicolons). <code>~/bin</code> and <code>~/.local/bin</code> are common places to put your own scripts — add them to PATH in <code>~/.bashrc</code>.

Windows → Linux context

What changes when you use this on Linux?

Equivalent task, different tool

Windows path maps to echo $PATH / export PATH for this task. Treat this as a workflow mapping rather than a character-for-character syntax translation.

Portable across the compared distros

The Debian/Ubuntu, Fedora and Arch rows use the same command in this mapping. Package availability or defaults can still vary, so check the installed tool version when an option behaves differently.

Practical tasks

Common use cases

View or modify the command search path

Shows or modifies the list of directories the shell searches when you type a command.

echo $PATH

Show current PATH

export PATH=$PATH:/new/dir

Add directory to PATH (this session)

which command

Check if command is in PATH

Ready to run

Copyable Linux commands

Review paths, device names, package names and permissions before running any command.

echo $PATH
export PATH=$PATH:~/bin
echo 'export PATH=$PATH:~/bin' >> ~/.bashrc
source ~/.bashrc

Walkthrough

Examples with explanations

# Windows: path
echo $PATH
# /usr/local/sbin:/usr/local/bin:/usr/bin:/bin

# Add a directory:
export PATH=$PATH:~/bin

# Make permanent (add to ~/.bashrc):
echo 'export PATH=$PATH:~/bin' >> ~/.bashrc
source ~/.bashrc

Reference

Common options and variations

Command or optionUse
echo $PATHShow current PATH
export PATH=$PATH:/new/dirAdd directory to PATH (this session)
which commandCheck if command is in PATH
hash -rClear command location cache after PATH change

Distro differences

Debian/Ubuntu vs Fedora vs Arch

Debian/Ubuntu, Fedora and Arch all use "echo $PATH / export PATH" for this mapping. The command syntax shown here is portable across the three rows, although installed versions and system defaults can still vary.

DistributionPackage manager / baseEquivalent commandDifference to notice
Debian/Ubuntu same command echo $PATH / export PATH Same command on this distribution.
Fedora same command echo $PATH / export PATH Same command on this distribution.
Arch same command echo $PATH / export PATH Same command on this distribution.

Keep learning

Related Terminal & Shell Scripting commands