child_creation_example.c - a C program that forks, executes, and waits upon a child process. It demonstrates the use of the getpid(), getppid(), fork(), execlp(), waitpid(), perror(), fprintf(), atexit(), and exit() syscalls/functions.
wait_syscall_example.c - a C program that demonstrates how the wait() system call is issued on a running child process.
system_syscall_implementation.c - a C program that implements the system() system call and attempts to use it to run the command whose name is passed as the command-line argument to ./system_syscall_implementation. For example, ./system_syscall_implementation "ls -al" will cause the ls -al command to run in the terminal.
daemon_creation.c - a C program that creates a daemon process and lets it sleep for 30 seconds. You can confirm that this daemon is running by typing: ps -xj in the terminal and seeing that the program ./daemon_creation has init with the process id of 1 as its parent (PPID = 1) and that it is not connected to any terminal (TTY = ?).
The command: gcc -Wall -Wextra -O2 -g -o program program.c
compiles the C source code located inside the file program.c. See more details here.
The command: . ./.short_prompt
executes code inside a file named .short_prompt and sources it (applies all the changes to the current session.) See more details here.
The command: . ./.long_prompt
executes code inside a file named .long_prompt and sources it (applies all the changes to the current session.) See more details here.
The command: vi /home/text.txt
opens the file at /home/text.txt inside the vi Linux text editor.
The command: /bin/sh -c someCommand
runs an instance of the sh shell interpreter and, within it, executes the Linux command provided by someCommand. After the command returns, the sh shell interpreter returns (terminates) as well, which returns control to the shell interpreter that was working in the terminal before this command was called (e.g., bash.) For instance, typing: /bin/sh -c ls -al will run the ls -al listing command within that new instance of sh.
The command: passwd
will prompt you to change the password for your Linux user account. You will first type your current password, re-type it, and then type the new password. The root privileged user can also change the passwords of other users by typing: passwd userName, where userName is the username of one of the device's/machine's users.
The command: cat myFile.txt | grep Hello | sort
alphabetically sorts the search results of the word "Hello" found in the file myFile.txt. The way this command works, just as ls -al | less does (see more about the less content viewer here), is by piping the output of one command as the input into the next command. That is, we 'project' the content of myFile.txt into the pattern-searching command grep, which then projects its search results into the sort command that sorts that input.
The command: ps -xj
outputs the list of all the processes running by your user, including daemons. Daemon processes will have the parent process ID (ppid) of 1 and will have a '?' under the TTY column, meaning that they aren't connected to any terminals (daemons are background processes that don't show their output in any terminal,) which is the definition of a daemon.