How to Check Path in Unix

Use the right command., Include the dollar sign, or the shell will just print "PATH" to your screen.), To find the location of a command, use the "which" or "type" commands: $ which ifconfig /sbin/ifconfig $ type ifconfig ifconfig is /sbin/ifconfig

5 Steps 1 min read Medium

Step-by-Step Guide

  1. Step 1: Use the right command.

    When you type in a command, the shell searches itself for built-in commands, then it searches the directories listed in your PATH variable.

    To check PATH, type "echo $PATH". $ echo $PATH /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin
  2. Step 2: Include the dollar sign

    This shows the directories checked, separated by colons. ,
  3. Step 3: or the shell will just print "PATH" to your screen.)

  4. Step 4: To find the location of a command

  5. Step 5: use the "which" or "type" commands: $ which ifconfig /sbin/ifconfig $ type ifconfig ifconfig is /sbin/ifconfig

Detailed Guide

When you type in a command, the shell searches itself for built-in commands, then it searches the directories listed in your PATH variable.

To check PATH, type "echo $PATH". $ echo $PATH /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin

This shows the directories checked, separated by colons. ,

About the Author

L

Lauren Murphy

Enthusiastic about teaching pet care techniques through clear, step-by-step guides.

44 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: