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
Step-by-Step Guide
-
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 -
Step 2: Include the dollar sign
This shows the directories checked, separated by colons. , -
Step 3: or the shell will just print "PATH" to your screen.)
-
Step 4: To find the location of a command
-
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
Lauren Murphy
Enthusiastic about teaching pet care techniques through clear, step-by-step guides.
Rate This Guide
How helpful was this guide? Click to rate: