Lab 5 - Managing Files
Question 1: Creating Files and Directories
- Create a Directory in YOUR home directory labeled:
lab5
. - Change your current working directory to
~/lab5
. - Create 3 directories:
pets
,docs
,songs
. Inside each directory, create 2 subdirectories called:new
andold
. - Inside the
new
andold
directories, create 3 files:file1
,file2
, andfile3
. - Use the
tree
command to list thelab5
directory.
Take a screenshot of the terminal only. Your screenshot must show all the commands that you used to answer questions 1-5. Multiple screenshots is allowed
Question 2: Removing Files and Directories
- Change your current working directory to:
/srv/
- Remove the
file1
,file2
,file3
files inside thelabs/pets/new/
directory without changing your current working directory. - Remove the
pets
directory without changing your current working directory. - Remove the
docs
andsongs
directories without changing your current working directory. - Remove the
lab5
directory without changing your current working directory.
Take a screenshot of the terminal only. Your screenshot must show all the commands that you used to answer questions 1-5. Multiple screenshots is allowed
Question 3: Moving Files and Directories
- Make sure that you are working on your home directory.
- Run the following command:
wget https://cis106.com/assets/lab5.zip && unzip lab5.zip && rm lab5.zip
- In your home directory, create the following directories:
lab5-imgs
,lab5-audio
,lab5-video
,lab5-docs
- Move all the files inside the
lab5
directory to their respective new directories in your home directory. - Inside the
lab5
directory, you will find a directory calledWallpaperslab5
. Move this directory to yourPictures
directory and rename it toNewWallpapers
. - Rename the
lab5
directory toLab-5
.
Take a screenshot of the terminal only. Your screenshot must show all the commands that you used to answer questions 1-5. Multiple screenshots is allowed
Question 4: Copying Files and Directories
- Go to pexels.com. Download at least 3 wallpapers.
- Copy the wallpapers to your
Pictures/NewWallpapers
directory. - Create a new directory in your
Downloads
directory (use whatever naming convention you want). Download 3 wallpapers and move them to your new directory. - Copy your new directory to the
Pictures
directory. - Remove the new directory in your
Downloads
directory.
Take a screenshot of the terminal only. Your screenshot must show all the commands that you used to answer questions 1-5. Multiple screenshots is allowed
Challenge Question:
- In your home directory, create a directory called:
lab5ChallengeQuestion
and inside this new directory create one directory calledassets
you must achieve this in a single command. - Download an image from this website: pexels.com and rename it
newPicture.png
. Move this image to yourassets directory
. You must move and rename the file in a single command. - From the root of the file system, create a file in the
lab5ChallengeQuestion
directory calledsite.html
- open the file
site.html
in a text editor (do not use vs code) and add the following text. Save the file and close the text editor.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>Challenge Question Lab 5</h1>
<img src="./assets/newPicture.png" alt="">
</body>
</html>
- Open the
site.html
file in firefox and take a screenshot. The image you downloaded should be shown there.
Take a screenshot of the commands you used to answer this question and of firefox showing the site.html file open.
What will you Submit:
- Place all the screenshots and answers to your questions in a the
lab5.md
file. - Convert your markdown file to pdf
- Push the changes to Github:
git pull; git add .; git commit -m "lab5 complete; git push"
- Submit the URL of
Lab5.md
and the pdf file - Take a snapshot of your system and delete the previous snapshot.
Special Note
You are going to be using the git commands a lot. Here is a quick reference:
git clone repository/url/here
: is the command to clone a repository where cloning means downloading a repository to your computergit pull
: to pull/synchronize your repository from github to your local machine. Always run this command BEFORE you start working VS Codegit add .
: to track all the changes made to your file.git commit -m "label for your changes here"
: this command will label all the changes you added with theadd
commandgit push
: will send all your changes to your github repository
Always run the commands in this order:
pull
=>add
=>commit
=>push
Never use the github website to make changes to your repository unless you know what you are doing and can remember to pull the changes before working on your local repository!