01. Basic commands¶
Practice¶
Author: Dr. Alejandra Rougon

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
🚴 Exercise 1¶
Go to your terminal either create a new one on CS50 or enter the already created virtual terminal
Create a new directory called
Lab1, then change directory toLab1and create the directoryplantsChange to the directory
plantsOnce you are there, print the working directory
🚴 Exercise 2¶
Inside
Lab1create another directory calledanimalsChange to directory called
rootusing the absolute pathChange to the
animalsdirectory using the relative pathVerify that you are in the directory
animalsNow move to the directory
plantsusing the relative pathVerify that you are in the directory
plantsChange to the
sandboxdirectory using the relative path
🚴 Exercise 3¶
Create a new directory called
fruitsand go insidefruitsFrom there, create a file inside the directory
animalscalledfishMove to the directory
fishFrom there, create a directory called
vegetablesinsideplantsMove to the directory
vegetables
Your file tree should look like this:

🚴 Exercise 4¶
Create a file called
my_fruitsinside the folderfruitscontaining the following data: apple bananaVerify it was created by listing the contents of the folder
View the contents of the file with
less,moreandcatRemove the word
bananafrom the filemy_fruitsand add two more lines: blueberries mangoMake a copy of
my_fruitsin the directoryLab1with the namemy_fruits.copyCreate the file
my_vegetablesin the directoryvegetablesthat contains two vegetables.Concatenate both files
my_fruitsandmy_vegetablesin a new file calledmy_speciesin the directoryplants.
Thank you for completing this activity!