How to find out the path in Unix: 3 steps (with pictures)

Table of contents:

How to find out the path in Unix: 3 steps (with pictures)
How to find out the path in Unix: 3 steps (with pictures)
Anonim

Have you ever got an error message after entering a simple command?

  • $ woot
  • bash: woot: command not found

This means that the command was either entered WRONG or simply does not exist in the system.

Steps

Check Path in Unix Step 1
Check Path in Unix Step 1

Step 1. Enter the correct command

When you enter a command, the UNIX shell searches itself for built-in commands and then looks for the folders specified in the PATH variables.

  • To check the path, enter "echo $ PATH".
  • Check Path in Unix Step 1
    Check Path in Unix Step 1
    • $ echo $ PATH

      / sbin: / usr / sbin: / bin: / usr / bin: / usr / X11R6 / bin: / usr / local / sbin: / usr / local / bin

Check Path in Unix Step 2
Check Path in Unix Step 2

Step 2. Turn on the dollar sign or the shell will only display the word "PATH" on the screen

The folders will be checked and divided into columns.

Check Path in Unix Step 3
Check Path in Unix Step 3

Step 3. To find the location of the command, use the which and type commands

  • $ which ifconfig;
  • / sbin / ifconfig;
  • $ type ifconfig;
  • ifconfig is / sbin / ifconfig.

Popular by topic