In the first part of the course, we will learn basic information about the Shell and popular Shell commands. We will practice using the command in the GitHub codespace.
A Unix shell is a command-line interpreter or shell 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.
Shell commonly refers to the UNIX shell environment, provides a command line user interface for Unix-like operating systems. Because desired actions are expressed as typed commands, it is possible to script (program) sets of those commands to be (re-)executed repetitively or conditionally. For example, it provides constructs for loops, functions, and conditions. In contrast to GUIs (graphical user interfaces), it allows for automation via scripting.
- 👀 Video 👀 Watch the first 20min video of my presentation from ABCD/RerproNim course for introduction to shell and a short demo session (I will share more of the video later during this course, so no need to watch more than till 19m54s)
Questions:
- Do you know what is the main difference between working with GUI and working with Shell?
- Do you know how can you determine what shell you’re currently in?
- Do you know what is bash?
As I mentioned before we will be using GitHub and GitHub Skills templates, if you are not familiar with GitHub and exercise, and you haven't had a chance to complete these 2 short GitHub courses, this is the time to do it before you start using the knowledge for this course.
- Introduction to GitHub
- Code with Codespace (the first 3 steps are enough for this course)
Questions:
- Do you know what are the branches in this repository? Do you know how to change the branch?
- Do you know how to create a Pull Request (i.e., update the main branch)?
- Do you know how to open Codepsace?
Tip
- I recommend opening another browser tab with this repository, so you can keep these instructions open for reference all the time.
- This is our first exercise (I will use ⌨️ for all exercises), so I will provide very detailed steps to guide you. Each execrice will have a similar structure, so it should become automatic very soon.
- 👀 Demo 👀 You can follow this demo TODO if you have any problems
- Opening Codespace with terminal
- Start from the landing page of your repository opened in new tab.
- Change the branch to "part1" (you should see a new content that was not in the
mainbranch) - Click the green "Code" button located in the middle of the page.
- Select the Codespaces tab in the box that pops up and then click the "Create codespace on part1" button.
- Verify your codespace is running. The browser should contain a VS Code web-based editor and a terminal.
- Practice using the command you learn about from the video in the first section. Here is a list and some examples:
echo $SHELLls,ls -l- try using
manto learn more about the commands, e.g.man ls mkdir tmp(we will not be saving content in this directory)cd tmp(move to this directory for practicing more commands)pwd(it should be the name of the repository)touch <filename>(if something is in brackets <> that means you should replace it with your own name, e.g.touch new_file.txt, note it is better to not use spaces in the filename)mv <existing_file> <new_file>cp <existing_file> <new_file>(you can practice using wildcart*)- practice using bash history (:arrow_up:,
ctrl+r,history) - practice using
tabcompletion
- Remove the
tmpdirectory to keep clean repository
cd ..(move one directory higher in the hierarchy)pwd(it should be the same as previously, the name of the repository)rm -r tmp(remove thetmpdirectory)
Tip
- This exercise has ⌨️ and ✅, that means you will have a specific task and the output will be checked by automatic tests I wrote for this course, and the repository will move to Part 2 after the task is completed.
- This is our first exercise of this type, so I will provide very detailed steps to guide you.
- 👀 Demo 👀 You can follow this demo TODO if you have any problems
- Go to terminal in Codespace (you can use the one that you opened in part 3, or follow the instruction from part 3 to open again)
- Create a new file (
week1/file1.txt) to the repository with content "Hello!":
- Go to
week1directory (if you don't see this directory, you're likely in wrong branch) - Create a new file
file1.txtwith a content "Hello" (you can usetouchor/andechocommand) - Add a new file to the repository and commit the changes
- Update the changes to the
mainbranch of the repository
- Create a Pull Request to the
mainbranch - Check the status of tests
- If all tests pass, merge the Pull Request, this should update a new
README.mdon the main page of the repository (you can reload the page after 30-60s if you don't see the new content)
Important
Following all the steps from part 4, including creating and merging the Pull Request, is necessary to move to the next parts of the course.
Get help: Submit an issue
Work was founded by BSSw Fellowship Program