Use the following cheat sheet for further information
In this challenge, you will be creating the directory that you'll be using to save your work throughout this Bootcamp. Just follow the below steps to guide you:
- Open the terminal (on Windows you should use GitBash)
- Go into your home directory by running the command
cd - Make sure you see this symbol
~when you write another terminal command, which means you are at Home. - Create a new directory called
Developmentinside Home folder usingmkdir - Use
lsto make sure that theDevelopmentdirectory was created. - Go into the
Developmentdirectory usingcd Development - Use
pwdto make sure you're in the right directory
- Create a new directory inside the
Developmentfolder, call itTerminal Challenge. lsafter that command. Did you create 2 folders? That's becausemkdircommand takes any number of parameters. If you add a space, it will think that you want to create another folder. Delete those 2 folders using the commandrm FOLDER_NAME- Did you get this error
rm: FOLDER_NAME: is a directory? That's becausermonly works for files, to remove a folder, you should use the commandrm -r FOLDER_NAME, this command deletes a folder and its content. lsto check that you deleted the 2 folders- Now create the folder
Terminal Challenge, but use another naming convention, which is connecting every word by an underscore. call itterminal_challenge. This is a better naming convention that every developer uses, it's going to make your life easier. Although you can name your files and folders with spaces, but that would just require you to wrap your folder/file name with quotation marks like thismkdir "folder name here".
-
Inside the terminal_challenge folder that you created in the previous task, create 4
.txtfiles by using the commandtouchin a single line.name.txtmajor.txthobbies.txtyear_of_birth.txt -
Now using the command
nano, go to every file and type your information. in name.txt file, you will just type your full name, and so on.nano FILE_NAME. Always try to type half of the file name, and press tab for auto complete. You might forget the extension if you don't autocomplete. -
After you complete all the information in all of the files, print their content out to the screen using the command
cat. Do that for every file.cat FILE_NAME
-
catis short forconcatenate, which means "link (things) together in a chain or series." And it has a nice feature of concatenating the content of differnet files, and printing them out. Try to concatenate the content of the 4 files you created using thecatcommand as followscat FILE_NAME FILE_NAME FILE_NAME FILE_NAME
-
You should see all the information now printed in a single command. Try to save the concatenated text in a file using the
>command after your concatenation as follows:cat FILE_NAME FILE_NAME FILE_NAME FILE_NAME > me.txtThis command will take the result of the command before the
>sign, which is printing out the concatenation of the 4 files, and putting them in a new file you called itme.txt. Now the result of the concatenation is saved in a file calledme.txt. Print out the content of the fileme.txtthat you created in the previous command using thecatagaincat me.txt. -
Now remove all the files
name.txtmajor.txthobbies.txtyear_of_birth.txtusing the commandrmin one line.rm FILE_NAME FILE_NAME FILE_NAME FILE_NAMEand just keepme.txt