Photo by Gabriel Heinzer on Unsplash
Day 11 of my ALX Software Engineering Journey: Shell basics, terminologies and shortcuts
Today, I learned basic commands in shells, shell terminologies and shortcuts in shell. Below is a summary:
Shell
Is a program that takes commands from the keyboard and delivers them to the operating system.
Bash
Is a program that runs on the shell. Its full meaning is Bourne Again Shell.
Terminal
Is a program that provides a window to interact with the shell.
Within the shell are directories that hold operational files. Some of them include:
/
points to the root directory where the file system begins.
/boot
This folder contains the Linux kernel and bootloader files.
/etc
contains configuration files for the system.
/usr
Contains programs the system requires to operate.
/dev
Contains devices available to the system.
Keyboard shortcuts in bash
Ctrl + C = interrupts the foreground process running in the terminal.
Ctrl + Z = suspends foreground process currently running in bash.
Ctrl + D = closes the bash shell, and performs the same function as an exit command.
Ctrl + L = This command clears the screen. It has similar command as clear.
Ctrl + S = halts all output to the screen. An example is when the output of a command is long enough to occupy the whole screen and you want to halt it, you use this command.
Ctrl + Q = Following Ctrl + S command, this command can be used to resume screen output.
Ctrl + XX: this command when pressed, allows one to go to the beginning of a line to make changes and when pressed again it returns the cursor to the original position.
Ctrl + D: deletes a character under the cursor.
Alt + D: deletes all characters after the cursor.
Ctrl + W: cuts the word before the cursor.
Ctrl + K: cuts the line after the cursor.
Ctrl + U: cuts the line before the cursor.
Ctrl + Y: pastes cut from the clipboard.
Alt + U: capitalized characters from the cursor to the end of a word.
Alt + L: uncapitalizes every character from the cursor to the end of the word.
Ctrl + R: recalls the last command when you provide a matching character.
Ctrl + O: runs command found with Ctrl + R.
Ctrl + G: leave history search mode initiated with Ctrl + R.
LTS
Stands for long-time support and it gives an idea of the duration of support to be given to a version of Linux before the next update.
Shebang
Is illustrated with the symbol #!
. It is used to tell the operating system what interpreter to use to parse the rest of a file. The symbol is usually written at the start of a bash script.
How to Read a Man page
A man page is a page in the shell that is used to describe the various functionalities of a shell command. It looks like this
Name: briefly describes the command and its function.
Synopsis: gives an illustration of options that can be combined with the command to yield a result.
Description: describes in detail the function of the command.