Creating from Terminal
Part 1 - Opening The Terminal
- To open the terminal in OSX
- hold
Commandand pressSpaceto open the spotlight search. - in the search bar, enter
terminal
- hold
- To open the git-bash terminal in Windows OS
- press the
Windowskey to open windows search. - in the search bar, enter
git bash.
- press the
Part 2 - Change Directory to the dev directory
- Execute
cd ~/devto change the current working directory todev cd ~/devcan be read verbally as “change directory tohome. From herenavigate todirectory nameddev”cdis a command used to change directories~is an alias recognized by the shell to reference the home directory/is a symbol used to expressnavigate to
- Execute
pwdto display the current working directory to verify that the command has executed properly. - Execute
lsto verify the contents of this directory.
Part 3 - Create a New Project Directory
- Execute
mkdir my-first-projectfrom thedevdirectory to create a new directory namedmy-first-projectin thedevdirectory - Execute
lsto verify that the directory has been created properly. - Execute
cd ./my-first-projectto change the current working directory to the newly created directory. cd ./my-first-projectcan be read verbally as “change directory tocurrent working directory. From here,navigate todirectory namedmy-first-project”cdis a command used to change directories.is an alias recognized by the shell to reference thecurrent working directory/is a symbol used to express “from here, navigate to”
- Execute
pwdto verify that you have navigated to the directory properly.
Part 4 - Create Directory Named empty-directory
- Execute
mkdir empty-directoryfrom themy-first-projectdirectory to create a new directory, namedempty-directory - Execute
lsto verify that the newly created directory, namedempty-directory, has been created in themy-first-projectdirectory. - Execute
cd ./empty-directoryto change the current working directory to the newly created directory - Execute
pwdto verify that you have navigated to the directory properly. - Execute
lsto verify that this directory is empty.
Part 5 - Navigate Back to my-first-project directory
- Execute
cd ..to navigate to the parent directory of the current working directory...is an alias recognized by the shell to reference theparent directory.- A parent directory is a directory which contains another directory.
- (for example,
my-first-projectis a child directory of the parent directory nameddev)
- (for example,
- Execute
pwdto verify that you have navigated to the directory properly. - Execute
lsto verify this directory contains a directory namedempty-directory.
Part 7 - Create Directory Named non-empty-directory
- Execute
mkdir non-empty-directoryfrom themy-first-projectdirectory to create a new directory namednon-empty-directory. - Execute
lsto verify that the newly created directory, namednon-empty directoryhas been created in the directory namedmy-first-project. - Execute
cd ./non-empty-directoryfrom themy-first-projectdirectory to change the current working directory tonon-empty-directory. - Execute
pwdto verify that you have navigated to the directory properly.
Part 8 - Create Directories Within non-empty-directory
- Execute
mkdir child-directory-1to create a new directory in thenon-empty-directory - Execute
lsto verify that the newly created directory, namedchild-directory-1has been created in directory namednon-empty-directory.` - Execute
mkdir child-directory-2to create a new directory in thenon-empty-directory - Execute
lsto verify that the newly created directory, namedchild-directory-2has been created in directory namednon-empty-directory.`
Part 9 - Create Files Within non-empty-directory
- Execute
touch some-fileto create a new file in thenon-empty-directory - Execute
touch some-text-file.txtto create a new text file in thenon-empty-directory - Execute
touch some-webpage-file.htmlto create a new webpage file in thenon-empty-directory - Execute
touch some-mp3-file.mp3to create a new mp3 file in thenon-empty-directory -
Execute
lsto verify that each of the child-resources are displayedchild-directory-1 child-directory-2 some-file some-mp3-file.mp3 some-text-file.txt some-webpage-file.html
Part 10 - Open File in nano editor
- Execute
nano some-text-file.txtto open the file namedsome-text-file.txtin the nano-editor. - Enter your name in the nano editor.
- From the keyboard, hold
Ctrland pressXto exit the editor - From the keyboard, press
Y, when prompted toSave modified buffer. - From the keyboard, press
Enter, when prompted toSave File Name. - Execute
cat some-text-file.txtto verify that the contents entered in thenanoeditor have been saved in thesome-text-file.txtfile.

Part 11 - Navigate Back to my-first-project directory
- Execute
cd ..to change to the parent directory of the current working directory...is an alias recognized by the shell to reference theparent directory.- A parent directory is the directory which contains another directory.
- (for example,
non-empty-directoryis a child directory _ of the _parent directory namedmy-first-project)
- (for example,
- Execute
pwdto verify that you have navigated to the directory properly. - Execute
lsto verify this directory contains a directory namedempty-directoryandnon-empty-directory.
Part 12 - Delete empty-directory
- Execute
rmdir ./empty-directoryto delete the empty directory- Note: - The
rmdircommand cannot delete a non-empty directory
- Note: - The
- Execute
lsto verify that this directory no longer contains a directory namedempty-directory
Part 13 - Delete non-empty-directory
- Execute
rmdir ./non-empty-directoryto verify that a directory that is not empty cannot be deleted via the commandrmdir. - Execute
lsto verify that the current working directory still contains a directory namednon-empty-directory - Execute
rm -rf ./non-empty-directoryto delete the the directory containing the content created inPart 9andPart 10 - Execute
lsto verify that this directory no longer contains a directory namednon-empty-directory
Part 14 - Fetching Command History
- Execute
historyto display the list of all the commands that have been executed in this terminal instance. - Execute
history > submission.txtto pipe the output of thehistorycommand to a file namedsubmission.txt- piping is a mechanism for injecting data from one place to another
- Execute
cat submission.txtto verify that thesubmission.txtfile contains the expected contents.

