Behind the curtain: the magic behind “ls -l *.c”

The kernel facilitates all interactions between hardware and software
The prompt is where you type commands
  • &buf, the address of the first character of the buffer where the input is stored
  • &bufsize, the address of the variable containing the buffer
  • stdin, in this case we read the input from standard input
  • str, is the string we want to parse
  • delim, is our delimiter which, in this case, will be the blank space
The type command is used to find out if command is builtin or an external file
The PATH environment variable is a colon-delimited list of directories the shell searches through when a command is entered.
Patrick isn’t technically a shell but close enough.
  • “ls” displays the files in the current directory
  • “-l” is an argument which causes the list to be in long format
  • “*.c” is a wildcard so that all files ending with the extension .c are dissplayed

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store