What happens when you type ls *.c

What happens when you type ls *.c

When you write ls *.c in your shell a process is triggered to assure the better answer.

ls command

After you hit the enter key the shell has to decide what kind of command has been entered. There are two categories that are possible: Internal command and External command. In general, we can see that internal commands are built into the shell and externals which are not built into the shell (see more: https://www.geeksforgeeks.org/internal-and-external-commands-in-linux/).

Once the shell finds out what category of command has the user entered they proceed to execute immediately, for internal ones, or to find it for externals ones.

PATH variable and its contents

But, how can the shell find the external command? The answer is as simple as powerful: using the environment, more accuracy the PATH global variable. But, PATH global variable? Yes, this variable contains the different directories where the shell can find the entered command. Therefore, the shell iterates the directories that PATH variable contains from the left to the right and for each try to find the command.

Once that happens the command is executed and its results reported to the user.

要查看或添加评论,请登录

Gonzalo Gomez Millan的更多文章

  • Linux, ELF, and Hacking!

    Linux, ELF, and Hacking!

    What is ELF? The Executable and Linkable Format, otherwise called ELF, is the nonexclusive document design for…

  • Why The Virtual Memory (VM)

    Why The Virtual Memory (VM)

    History in short In 1979 was implemented the 3BSD by researchers at Berkeley. That was the first Unix release with…

  • Hacking The Linux Kernel

    Hacking The Linux Kernel

    Linux architecture has a lot of relevant pieces that allow it to work flexibly and powerfully. The file system /proc is…

  • Voici d'emploi - Job posting on third platforms (Torre.co)

    Voici d'emploi - Job posting on third platforms (Torre.co)

    Our project helps people solve a critical problem: find a job. In this case, is through making viral on the internet…

  • Post-incident analysis

    Post-incident analysis

    A new functional requirement that was developed without doing an impact analysis on the architecture. Issue summary As…

  • Internet of things as a day-to-day story

    Internet of things as a day-to-day story

    It was 1999. Kevin Ashton worked for Procter & Gamble (P&G), and was 28 years old and tried to solve a problem: the…

  • How Do SQL Database Engines Work?

    How Do SQL Database Engines Work?

    To many programmers, SQL RDBMS is a magical black box. A document can help clear up a lot of the mystery.

  • Artificial Intelligence vs Machine Learning

    Artificial Intelligence vs Machine Learning

    For dummies - In memory of Margarita, my grandmother! What about Artificial Intelligence (I.A.

  • Python is powerful but could be tricky

    Python is powerful but could be tricky

    What keep in mind to avoid the tricky and get the power Python is an interpreted, high-level, general-purpose…

  • Do you want to take speed in the development software process? (II)

    Do you want to take speed in the development software process? (II)

    Without libraries what have we? We have no past and no future! In programming, a library is a collection of…

社区洞察

其他会员也浏览了