What happens when you type `ls -l *.c`? in the shell ?
Not the shell you were expecting i know

What happens when you type `ls -l *.c` in the shell ?

To begin with i'am expecting that you have a basic knowledge about shell scripting and linux command.

You have to understand what a shell is in relation to the kernel to understand what really happens when you run a command.

No alt text provided for this image

The Kernel is the most fundamental part of a computer operating system. It’s a program itself and it controls all other programs on the computer. It talks to hardware and software and is highly involved in resource management.

The Shell is an application that executes programs called commands through an interactive user interface with an operating system. It is the layer of programming that understands and executes the commands a user enters. In some systems, the shell is called a command interpreter.

SO WHAT DOES REALLY HAPPEN WHEN YOU TYPE ls *.c?

LS

Among the many shell commands at your disposal, ls remains among the most heavily used commands in shell. When you type man ls and hit enter, the manual page for the command ls appears, and it is here where you can learn all about the command.

No alt text provided for this image

Briefly talking from the description we know that ls displays information about the files in a certain directory (current directory by default).

Ls *.c

One of the available ls options is the “ls”, and this command has three parts. The first part is the “ls”, this part does what we see in the previous part “Ls Command”. Then, we have the “*” part, the symbol * in this case means all things in the current directory (all the files, and directories), and the last part is “.c”, in this case it means, everything that ends whit the characters “.c”.

No alt text provided for this image

We can see that if we type the command “ls *.c”, all files that ends with the .c format will show up.

CONCLUSION

The final result after the shell communicates with the kernel to run the ls command is output to the user displaying all files ending with the .c extension without the user even noticing the work involved in making this happen.

AUTHORS

This blog was made as part of the curriculum in HOLBERTON SCHOOL

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

Mahdi Bani的更多文章

  • Large Language Models: The Wizards Behind Your Text Generation Magic

    Large Language Models: The Wizards Behind Your Text Generation Magic

    Once upon a time, in the mysterious realm of machine learning, Large Language Models (LLMs) were the secret sauce of AI…

  • Journey of My Malware Classification Project

    Journey of My Malware Classification Project

    Introduction: Embarking on a journey to classify malware using deep learning has been both a challenging and rewarding…

    1 条评论
  • Transfer Learning for CIFAR-10 Classification Using ResNet50

    Transfer Learning for CIFAR-10 Classification Using ResNet50

    Abstract: In this article, we implement transfer learning to classify images in the CIFAR-10 dataset using a…

  • My Journey in Developing a Malware Classifier

    My Journey in Developing a Malware Classifier

    Embarking on the journey of developing a malware classifier was both a challenge and an opportunity for growth. In this…

  • Unlocking the Future: A Deep Dive into BTC Price Forecasting

    Unlocking the Future: A Deep Dive into BTC Price Forecasting

    Cryptocurrencies are more popular with years, especially Bitcoin , have captured the attention of investors worldwide…

  • The art of optimization

    The art of optimization

    Optimization is critical in machine learning because it helps to find the best set of model parameters, minimize the…

  • Activation Functions in Neural Networks

    Activation Functions in Neural Networks

    When someone decide to read more about how artificial intelligence work , the sentence "activation functions" will be…

  • Is everything an object in python ?

    Is everything an object in python ?

    Unlike the other language, Python is an OOP(object oriented programming) language and that mean it can organizes…

  • C static libraries

    C static libraries

    what is static libraries? In the C programming language, a static library is a compiled object file containing all…

社区洞察

其他会员也浏览了