Sunday, March 1, 2015

cd - Python Tutorial

cdcd – Change Directory gives us the ability to change through our directories while we are in the terminal.


cd Examples


In these cd examples we are going to use our Mac terminal.  If you are following along open your Mac terminal and try some of these commands.


#cd to directory but first we need to know what directories are in the current directory

Thomass-MBP:~ Tommy$ ls
Applications Downloads Pictures
Creative Cloud Files Library Public
Desktop Movies
Documents Music
Thomass-MBP:~ Tommy$ cd desktop
Thomass-MBP:desktop Tommy$

#go back a directory
Thomass-MBP:desktop Tommy$ cd ..
Thomass-MBP:~ Tommy$

#Change to root directory
Thomass-MBP:~ Tommy$ cd /
Thomass-MBP:/ Tommy$

#change to home directory
Thomass-MBP:/ Tommy$ cd ~
Thomass-MBP:~ Tommy$

 



cd

No comments:

Post a Comment