# Week Two at the Blockfuse Labs (Cohort III web2): Linux commands and Shell Scripting The terminal also known as shell or Command-Line Interface (CLI) is the interface that lets you (user) communicate with the Linux operating system by typing commands. The default shell in most Linux distributions is bash (Bourne Again SHell). Commands are entered in a prompt, and the system immediately executes them. Linux commands are instructions entered into a command-line interface to perform various tasks on a Linux operating system. These commands cover a wide range of functionalities, from file and directory manipulation to system administration and more. Some key Linux commands I learnt includes (but not limited) to the following: **pwd:** Displays the current working directory. **ls:** Lists the contents of a directory. **cd:** Changes the current directory. **mkdir:** Creates a new directory. **rm:** Removes files or directories. **cp:** Copies files or directories. **mv:** Moves or renames files or directories. **cat:** Concatenates and displays file contents. **touch:** Creates an empty file. **man:** Displays the manual page for a command. **grep:** Searches for a specific string within files. **echo:** Prints text to the terminal. **sudo:** Executes a command with superuser privileges. **chmod:** Changes the permissions of a file or directory. **chown:** Changes the ownership of a file or directory. **whoami:** Displays the current username. Each of these commands plays a vital role in system navigation, file management, and security. I learnt that Linux is a multi user OS which means that it supports multiple users at a time. Therefore, since many people can access the system simultaneously and some resources are shared, Linux controls access through ownership and permissions. Ownership of files in Linux are divided into three categories (types): ***user, group, and others*** . ***User:*** A user is the default owner and creator of the file. So this user is called owner as well. **Group:** A user-group is a collection of users. Users that belonging to a group will have the same Linux group permissions to access a file/ folder. **Other**: Any user that are not part of the user or group classes belong to this category. In the week that was, I also learnt about *Linux File Permissions* and I was made to understand that File permissions fall into three categories: read, write, and execute. **Read permission**( r ): allow users to open and read the file only. Users can't modify the file. **Write permission**( w ):the user can modify (edit, delete) the file and save it. While **Execute permission** ( x): with this permission, users are allowed to run an executable script. ## **Error(s) encountered while learning Linux** I encountered many challenges and errors while learning to navigate with Linux but the most common one was on chmod: - Permission denied (if you're not the owner) - and got to learn that the user can use sudo if needed. Sudo simply stands for "superuser do". It is a command in Linux and other Unix-like systems that allows a permitted user to execute a command as the superuser (root) or another user. ## **Shell Scripting** Shell scripts are files that contains sets of commands in an executable manner. We learnt how to create a simple shell script in vim (a text editor) and also execute it. This topic is still a work in progress and I hope to master it with time and dedication to study. ## **Conclusion** Learning the Linux command line may seem daunting at the moment, but I believe that it becomes a valuable tool the more I use it and the errors I encounter now will only make me get better with constant practice and wider research.