ga-wdi-exercises / to_oz

Navigate the directory tree using the command line. [cli, basics]
0 stars 49 forks source link

CLI HW (Fitssum Haile) #228

Closed Fitssum closed 7 years ago

Fitssum commented 7 years ago

Last login: Mon May 1 21:39:55 on ttys000 Mon May 01 21:42:41 ~ $ cd wdi Mon May 01 21:42:47 ~/wdi $ cd homework Mon May 01 21:42:57 ~/wdi/homework $ mkdir House Mon May 01 21:43:23 ~/wdi/homework $ cd House Mon May 01 21:43:32 ~/wdi/homework/House $ touch Dorothy.txt Toto.txt Mon May 01 21:43:53 ~/wdi/homework/House $ mkdir Oz Mon May 01 21:44:13 ~/wdi/homework/House $ cd Oz Mon May 01 21:44:26 ~/wdi/homework/House/Oz $ touch Good_Witch_of_the_North.txt Wicked_Witch_of_the_East.txt Good_Witch_of_the_South.txt Wicked_Witch_of_the_West.txt Mon May 01 21:46:54 ~/wdi/homework/House/Oz $ rm Wicked_Witch_of_the_East.txt Mon May 01 21:47:49 ~/wdi/homework/House/Oz $ ls Good_Witch_of_the_North.txt Wicked_Witch_of_the_West.txt Good_Witch_of_the_South.txt Mon May 01 21:47:53 ~/wdi/homework/House/Oz $ cd ../ Mon May 01 21:48:56 ~/wdi/homework/House $ mv Dorothy.txt ~/wdi/homework/House/Oz Mon May 01 21:56:13 ~/wdi/homework/House $ touch Scarecrow.txt Tin_Man.txt Cowardly_Lion.txt Mon May 01 21:57:58 ~/wdi/homework/House $ mkdir Emrald_City Mon May 01 21:58:22 ~/wdi/homework/House $ cd Emrald_City Mon May 01 21:58:52 ~/wdi/homework/House/Emrald_City $ cd ../ Mon May 01 21:59:21 ~/wdi/homework/House $ mkdir the_gang Mon May 01 21:59:56 ~/wdi/homework/House $ mvdir ~/wdi/homework/House/the_gang ~/wdi/homework/House/Emrald_City -bash: mvdir: command not found Mon May 01 22:00:56 ~/wdi/homework/House $ mv ~/wdi/homework/House/the_gang ~/wdi/homework/House/Emrald_City Mon May 01 22:01:44 ~/wdi/homework/House $ cd Emrald_City Mon May 01 22:02:21 ~/wdi/homework/House/Emrald_City $ ls the_gang Mon May 01 22:02:23 ~/wdi/homework/House/Emrald_City $ cd ../ Mon May 01 22:03:31 ~/wdi/homework/House $ cd Oz Mon May 01 22:03:52 ~/wdi/homework/House/Oz $ mkdir Flying_Monkeys Mon May 01 22:04:34 ~/wdi/homework/House/Oz $ ls Dorothy.txt Good_Witch_of_the_South.txt Flying_Monkeys Wicked_Witch_of_the_West.txt Good_Witch_of_the_North.txt Mon May 01 22:04:39 ~/wdi/homework/House/Oz $ rm Wicked_Witch_of_the_West.txt Mon May 01 22:05:12 ~/wdi/homework/House/Oz $ echo diploma > ~/wdi/homework/House/scarecrow.txt Mon May 01 22:16:31 ~/wdi/homework/House/Oz $ echo A heart shaped watch > ~/wdi/homework/House/Tin_Man.txt Mon May 01 22:18:22 ~/wdi/homework/House/Oz $ echo medal > ~/wdi/homework/House/Cowardly_Lion.txt Mon May 01 22:20:33 ~/wdi/homework/House/Oz $

superbuggy commented 7 years ago

Great work! If you need to create or interact with files with spaces in the file name, you can use the following approaches:

 $ mkdir "Wicked Witch of the West"
 $ touch File\ Name\ With\ Spaces\ Using\ Backslash

\ is used here as an escape character, meaning that it causes the character immediately after it to be designated as a character or symbol, in this case, a space ( ), rather than a separator that goes between arguments.

If we entered mkdir Good Witch of the East, we'd get 5 folders respectively named Good, Witch, of, the, and East.