Welcome to the Linux Foundation Forum!

I need some explanation about practice lab 1.1

First of all, sorry my english.

More or less its not difficult to me read and understand, but write and speaking its a more difficult.

Well, as i spoke in the title, i need some explanation about the final in the practice lab 1.1

it says:

"Thus, in this course we would have to be constantly reminding you of the full path to many system administration utilities; any enhancement to security is probably not worth the extra typing and figuring out which directories these programs are in. Consequently, we suggest you add the following line to the .bashrc file in your home directory:

PATH=$PATH:/usr/sbin:/sbin"

I add that lines to my .bashrc not root user, and i found some information about that in internet, but its not clear at all why do this.

Thanks in advance and sorry again my english.

 

Comments

  • Kobberholm
    Kobberholm Posts: 1
    edited November 2017

    The PATH variable is a list of directories searched for a matching executable when you type a command.

    When you enter "ls" in a shell and hit the enter key, the system does not automatically know what "ls" means and it does not search your entire hard drive, instead it reads the PATH variable and looks in each directory specified until it finds an executable file names "ls".

    If you did not have a PATH variable, you would need to write the full path to all commands, so instead of "ls", you would have to write "/bin/ls" and instead of "curl" you would type "/usr/bin/curl", but since you DO have a PATH variable and both the directory /bin and /usr/bin are in your PATH, the shell will find them for you.

  • for what I understand, once you login whatever the value to the right will be available to your PATH. 

    so in your example, any executable in /usr/bin and /sbin will be callable with their names. 

     

  • Hi David,

    You also can post in spanish here!

    The .bashrc file can setup somethings, like variables, as PATH. So, the main purpose of this is to use files (mostly binaries) that are in the PATH without specifying all the route to it.

    ¡Saludos!

    Luis.

Categories

Upcoming Training