What happens when you type ls *.c

What happens when you type ls *.c

When we think of a command we must also think of the environment that performs its function, and for this case, this environment is called SHELL, also called interpreting commands or command interpreter, which provides an interface to the user to access the services of the operating system.

Knowing this, we can give our code space to carry out its work.

Knowing this, we can give our code space to carry out its work.

We could say that 'ls' is one of the most used commands in the LINUX SHELL, which lists the files and directories that are in the current working directory, showing from hidden files with the '-a' option to the information More detailed with the '-l' option, finding this feature-rich command to list and display the contents of working directories.

No hay texto alternativo para esta imagen

At this moment we seek to solve the question that we have in the title, what happens when I write 'ls * .c' ?, already understanding that 'ls' is a command to list the contents of the working directory, we will find it easier to understand the functionality of 'ls * .c'.

The '*' character has the specialty of being taken by the shell, as a reference to any character string in the name of a file, this character is among the group of wildcards that we have to complement some commands, as we see in the example with echo command.

No hay texto alternativo para esta imagen

At this moment we have the command 'ls *' which translated into our serious language, list all the files and directories, if we add a value to search for this, which in this case is an extension of a '.c' file, with This extension would translate like this, listing all the files and / or directories that contain in its name '.c', which would give a result similar to how we find it in the image.

No hay texto alternativo para esta imagen

In this case the command found 2 files with these characteristics in the working directory.

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

Didier Revelo的更多文章

  • ?Quién es el impostor?

    ?Quién es el impostor?

    ?Quién es el impostor?, huuum, aunque suena a título de videojuego o a película de espías, esta es la pregunta más…

    1 条评论
  • LO BUENO, LO MALO Y LO FEO DE QUERER SER PROGRAMADOR

    LO BUENO, LO MALO Y LO FEO DE QUERER SER PROGRAMADOR

    Primero dire que todo lo contenido en esta publicación es mi punto de vista y no debería afectar la decisión de…

    4 条评论
  • ONE STEP FORWARD, ONE STEP TO THE FUTURE.

    ONE STEP FORWARD, ONE STEP TO THE FUTURE.

    Our project sought the connection and consumption of the API Stripe, with the banking platform called Bankity. our team…

    4 条评论
  • WHY USE LIBRARIES? RELOADED.

    WHY USE LIBRARIES? RELOADED.

    Libraries. As we create programs, we find that some pieces of code are repeated over and over again in our work and we…

  • WHY USE LIBRARIES?

    WHY USE LIBRARIES?

    If we think for a moment about a library, we could conclude that libraries store information, but this would only be…

  • What happens when you type gcc main.c?

    What happens when you type gcc main.c?

    Have you ever wondered what happens when you create a C-based code and compile it with GCC? very well if you asked…

  • What is the difference between a hard link and a symbolic link?

    What is the difference between a hard link and a symbolic link?

    If you are starting in the fascinating world of programming, and you have come across the words "HARD LINK" and…

社区洞察

其他会员也浏览了