The UNIX_COMMAND ls -l *.c
Unix systems comprises of a number of commands when it comes to working with the shell/ terminal line.
In this article we will dwell much on the UNIX command ls -l, and what happens when one enters ls -l *.c in a shell.
According to TutorialsPoint (2021), a Shell is an environment in which we can run our commands, programs, and shell scripts. It can be said to be a command-line interpreter that provides a command line user interface for Unix-like operating systems. The shell is both an interactive command language and a scripting language, and is used by the operating system to control the execution of the system using shell scripts.
Therefore, when one enters a certain command in the shell, a particular output is retrieved according to what the command does in the background. For instance, in this case, the command ls lists information about the FILES (the current directory by default). It sorts entries alphabetically if none of -cftuvSUX nor --sort is specified.
More details about --sort command can be found using the link below:
Therefore the UNIX ls -l command provides a detailed information about each files and the sub-directory in the current folder.
The use of this command can be considered equivalent to entering "dir/V" in the Windows command prompt. The ls -l command reveals at least seven facts about each item in the working directory. For instance, in the output below:
The word "total" is followed by the number of file system blocks that the directory's files occupy. Each subsequent line supplies details on a single item. The first character specifies the folder or file type. It is a directory if the letter "d" appears.
UNIX uses hyphens to identify standard files; various letters denote specialized data files and links. This identifier is directly followed by a set of nine letters and hyphens. They disclose the item's security permissions.
The first three permissions apply to the file's owner, and the next set pertains to members of the owner's group. The final three characters identify access permissions for all other users.
A user or group is allowed to read an item if its permissions contain the letter "r." The letter "w" indicates that someone can modify the file by writing to it. An "x" means that users have permission to run the file if it's an executable program. Hyphens appear when permissions have not been granted.
The next item in each ls -l listing is the number of links. A file typically has one link, but there are more links if it has aliases. The count starts at two for folders because UNIX considers the parent and current directories to be links. This figure includes the number of sub-directories in a folder as well.
Therefore when a user enters ls -l *.c in the shell a list of all files with a .c extension is retrieved and also indicating the owner and group assigned to those files. The file size follows the group name; which is measured in bytes. Regardless of how many these .c files it contains, the size of a directory is normally 2,048 bytes.
Furthermore, a calendar date appears after each file size. The year or a specific time of such files are also indicated.
This is the date when the item was last modified, if the file has never been changed, a creation date is what appears.
Finally, the name of a file or directory then appears at the end of each line.