Creating from Terminal
Part 1 - Opening The Terminal
- To open the terminal in OSX
- hold
Command
and pressSpace
to open the spotlight search. - in the search bar, enter
terminal
- hold
- To open the git-bash terminal in Windows OS
- press the
Windows
key to open windows search. - in the search bar, enter
git bash
.
- press the
Part 2 - Change Directory to the dev
directory
- Execute
cd ~/dev
to change the current working directory todev
cd ~/dev
can be read verbally as “change directory tohome
. From herenavigate to
directory nameddev
”cd
is 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
pwd
to display the current working directory to verify that the command has executed properly. - Execute
ls
to verify the contents of this directory.
Part 3 - Create a New Project Directory
- Execute
mkdir my-first-project
from thedev
directory to create a new directory namedmy-first-project
in thedev
directory - Execute
ls
to verify that the directory has been created properly. - Execute
cd ./my-first-project
to change the current working directory to the newly created directory. cd ./my-first-project
can be read verbally as “change directory tocurrent working directory
. From here,navigate to
directory namedmy-first-project
”cd
is 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
pwd
to verify that you have navigated to the directory properly.
Part 4 - Create Directory Named empty-directory
- Execute
mkdir empty-directory
from themy-first-project
directory to create a new directory, namedempty-directory
- Execute
ls
to verify that the newly created directory, namedempty-directory
, has been created in themy-first-project
directory. - Execute
cd ./empty-directory
to change the current working directory to the newly created directory - Execute
pwd
to verify that you have navigated to the directory properly. - Execute
ls
to 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-project
is a child directory of the parent directory nameddev
)
- (for example,
- Execute
pwd
to verify that you have navigated to the directory properly. - Execute
ls
to verify this directory contains a directory namedempty-directory
.
Part 7 - Create Directory Named non-empty-directory
- Execute
mkdir non-empty-directory
from themy-first-project
directory to create a new directory namednon-empty-directory
. - Execute
ls
to verify that the newly created directory, namednon-empty directory
has been created in the directory namedmy-first-project
. - Execute
cd ./non-empty-directory
from themy-first-project
directory to change the current working directory tonon-empty-directory
. - Execute
pwd
to verify that you have navigated to the directory properly.
Part 8 - Create Directories Within non-empty-directory
- Execute
mkdir child-directory-1
to create a new directory in thenon-empty-directory
- Execute
ls
to verify that the newly created directory, namedchild-directory-1
has been created in directory namednon-empty-directory
.` - Execute
mkdir child-directory-2
to create a new directory in thenon-empty-directory
- Execute
ls
to verify that the newly created directory, namedchild-directory-2
has been created in directory namednon-empty-directory
.`
Part 9 - Create Files Within non-empty-directory
- Execute
touch some-file
to create a new file in thenon-empty-directory
- Execute
touch some-text-file.txt
to create a new text file in thenon-empty-directory
- Execute
touch some-webpage-file.html
to create a new webpage file in thenon-empty-directory
- Execute
touch some-mp3-file.mp3
to create a new mp3 file in thenon-empty-directory
-
Execute
ls
to 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.txt
to open the file namedsome-text-file.txt
in the nano-editor. - Enter your name in the nano editor.
- From the keyboard, hold
Ctrl
and pressX
to 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.txt
to verify that the contents entered in thenano
editor have been saved in thesome-text-file.txt
file.
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-directory
is a child directory _ of the _parent directory namedmy-first-project
)
- (for example,
- Execute
pwd
to verify that you have navigated to the directory properly. - Execute
ls
to verify this directory contains a directory namedempty-directory
andnon-empty-directory
.
Part 12 - Delete empty-directory
- Execute
rmdir ./empty-directory
to delete the empty directory- Note: - The
rmdir
command cannot delete a non-empty directory
- Note: - The
- Execute
ls
to verify that this directory no longer contains a directory namedempty-directory
Part 13 - Delete non-empty-directory
- Execute
rmdir ./non-empty-directory
to verify that a directory that is not empty cannot be deleted via the commandrmdir
. - Execute
ls
to verify that the current working directory still contains a directory namednon-empty-directory
- Execute
rm -rf ./non-empty-directory
to delete the the directory containing the content created inPart 9
andPart 10
- Execute
ls
to verify that this directory no longer contains a directory namednon-empty-directory
Part 14 - Fetching Command History
- Execute
history
to display the list of all the commands that have been executed in this terminal instance. - Execute
history > submission.txt
to pipe the output of thehistory
command to a file namedsubmission.txt
- piping is a mechanism for injecting data from one place to another
- Execute
cat submission.txt
to verify that thesubmission.txt
file contains the expected contents.