ga-wdi-exercises / to_oz

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

CLI HW (Christopher Jaffier) #134

Closed chrisjaff closed 8 years ago

chrisjaff commented 8 years ago

Last login: Wed Sep 7 20:28:20 on ttys001 Chriss-MBP:~ chrisd$ pwd /Users/chrisd Chriss-MBP:~ chrisd$ ls Applications Downloads Movies Practice index.html Desktop House Music Public index2.html Documents Library Pictures clear wdi Chriss-MBP:~ chrisd$ rm House rm: House: is a directory Chriss-MBP:~ chrisd$ rm r- House rm: r-: No such file or directory rm: House: is a directory Chriss-MBP:~ chrisd$ rm r-House rm: r-House: No such file or directory Chriss-MBP:~ chrisd$ rm -r House Chriss-MBP:~ chrisd$ ls Applications Downloads Music Public index2.html Desktop Library Pictures clear wdi Documents Movies Practice index.html Chriss-MBP:~ chrisd$ clear

Chriss-MBP:~ chrisd$ mkdir House Chriss-MBP:~ chrisd$ ls Applications Downloads Movies Practice index.html Desktop House Music Public index2.html Documents Library Pictures clear wdi Chriss-MBP:~ chrisd$ cd House Chriss-MBP:House chrisd$ touch Dorothy.txt Chriss-MBP:House chrisd$ touch Toto.txt Chriss-MBP:House chrisd$ ls Dorothy.txt Toto.txt Chriss-MBP:House chrisd$ mkdir Oz Chriss-MBP:House chrisd$ ls Dorothy.txt Oz Toto.txt Chriss-MBP:House chrisd$ cd Oz Chriss-MBP:Oz chrisd$ touch Good Witch of the North.txt Chriss-MBP:Oz chrisd$ touch Wicked Witch of the East.txt Chriss-MBP:Oz chrisd$ touch Good Witch of the South.txt Chriss-MBP:Oz chrisd$ touch Wicked Witch of the West.txt Chriss-MBP:Oz chrisd$ ls East.txt North.txt West.txt Witch the Good South.txt Wicked of Chriss-MBP:Oz chrisd$ rm Wicked Witch of the West.txt Chriss-MBP:Oz chrisd$ ls East.txt Good North.txt South.txt Chriss-MBP:Oz chrisd$ mv Dorothy.txt Oz/ mv: rename Dorothy.txt to Oz/: No such file or directory Chriss-MBP:Oz chrisd$ mv Dorothy.txt ./Oz mv: rename Dorothy.txt to ./Oz: No such file or directory Chriss-MBP:Oz chrisd$ pwd /Users/chrisd/House/Oz Chriss-MBP:Oz chrisd$ ls East.txt Good North.txt South.txt Chriss-MBP:Oz chrisd$ cd Oz -bash: cd: Oz: No such file or directory Chriss-MBP:Oz chrisd$ pwd /Users/chrisd/House/Oz Chriss-MBP:Oz chrisd$ ls East.txt Good North.txt South.txt Chriss-MBP:Oz chrisd$ touch Dorothy.txt Chriss-MBP:Oz chrisd$ ls Dorothy.txt East.txt Good North.txt South.txt Chriss-MBP:Oz chrisd$ cd .. Chriss-MBP:House chrisd$ ls Dorothy.txt Oz Toto.txt Chriss-MBP:House chrisd$ mv Dorothy.txt Oz/ Chriss-MBP:House chrisd$ ls Oz Toto.txt Chriss-MBP:House chrisd$ cd Oz Chriss-MBP:Oz chrisd$ ls Dorothy.txt East.txt Good North.txt South.txt Chriss-MBP:Oz chrisd$ pwd /Users/chrisd/House/Oz Chriss-MBP:Oz chrisd$ touch Scarecrow.txt Chriss-MBP:Oz chrisd$ touch Tin Man.txt Chriss-MBP:Oz chrisd$ touch Cowardly Lion.txt Chriss-MBP:Oz chrisd$ ls Cowardly East.txt Lion.txt North.txt South.txt Dorothy.txt Good Man.txt Scarecrow.txt Tin Chriss-MBP:Oz chrisd$ mkdir Emerald City Chriss-MBP:Oz chrisd$ ls City East.txt Lion.txt Scarecrow.txt Cowardly Emerald Man.txt South.txt Dorothy.txt Good North.txt Tin Chriss-MBP:Oz chrisd$ rm Wicked Witch of the East.txt rm: Wicked: No such file or directory rm: Witch: No such file or directory rm: of: No such file or directory rm: the: No such file or directory Chriss-MBP:Oz chrisd$ rm East.txt rm: East.txt: No such file or directory Chriss-MBP:Oz chrisd$ mv Scarecrow.txt Emerald City/ Chriss-MBP:Oz chrisd$ ls City Dorothy.txt Lion.txt North.txt Tin Cowardly Good Man.txt South.txt Chriss-MBP:Oz chrisd$ mv Tin Man.txt Emerald City/ mv: Emerald: No such file or directory Chriss-MBP:Oz chrisd$ mv Cowardly Lion.txt Emerald City/ mv: Emerald: No such file or directory Chriss-MBP:Oz chrisd$ mv Cowardly Lion.txt City/ mv: Cowardly: No such file or directory mv: Lion.txt: No such file or directory Chriss-MBP:Oz chrisd$ ls City Dorothy.txt Good North.txt South.txt Chriss-MBP:Oz chrisd$ cd Emerald City -bash: cd: Emerald: No such file or directory Chriss-MBP:Oz chrisd$ cd City Chriss-MBP:City chrisd$ ls Cowardly Lion.txt Scarecrow.txt Emerald Man.txt Tin Chriss-MBP:City chrisd$ cd .. Chriss-MBP:Oz chrisd$ ls City Dorothy.txt Good North.txt South.txt Chriss-MBP:Oz chrisd$ mv Dorothy.txt City/ Chriss-MBP:Oz chrisd$ ls City Good North.txt South.txt Chriss-MBP:Oz chrisd$ pwd /Users/chrisd/House/Oz Chriss-MBP:Oz chrisd$ cd.. -bash: cd..: command not found Chriss-MBP:Oz chrisd$ cd .. Chriss-MBP:House chrisd$ ls Oz Toto.txt Chriss-MBP:House chrisd$ cd Oz Chriss-MBP:Oz chrisd$ ls City Good North.txt South.txt Chriss-MBP:Oz chrisd$ echo Scarecrow.txt > diploma Chriss-MBP:Oz chrisd$ echo Tin Man.txt > heart shaped watch Chriss-MBP:Oz chrisd$ echo Lion > medal Chriss-MBP:Oz chrisd$ ls City North.txt diploma medal Good South.txt heart Chriss-MBP:Oz chrisd$

chrisjaff commented 8 years ago

It appeared as though my files would rename themselves at times. It made things a little confusing, but I was able to figure it out.

amaseda commented 8 years ago

Whenever you use the recursive flag, you should write it out as -r, not r-.

amaseda commented 8 years ago

Yeah, mv can be used to rename files as well as actually move them. That's probably what happened.

amaseda commented 8 years ago

:+1:

Also make sure to use backticks when placing code inside of a Github issue. It makes it a lot more readable!