forked from MarneeDear/softwarecarpentry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnavigation.txt
102 lines (69 loc) · 2.75 KB
/
navigation.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# cd stands for change directories
# a directory is the same a folder. when you see a folder icon in your
# file system explorer (finder), you are looking at a directory
cd Desktop
# this will take you to the Deskop. You are probably familiar with all
# the stuff you have on your Desktop. This the big screen you see when
# you login to you computer
# pwd stands for present working directory
# this command will tell you the "absolute" path to where you are in the
# filesystem
pwd
# you should see something that kind of looks like something you have
# seen before
# it looks like a ... URL. It looks like a way to get to a website
# That is because they are the same thing.
# URLs tell you how to get to a website and website page
# paths tell you how to get to files and directories
# pwd tells you how to get to where you are now
# If you were clicking on folders, these are the folder you would
# have to click in order to get to where you are
# what does pwd tell you right now? Can you get there using Windows
# Explorer or Finder?
pwd
# this shows us the absolute path
# this is the from the starting point of the files system (the c: for
instance)
# to where you are now
# we can also ask the shell to show us a list of files in the
# directory where we are or other directories using the relative path
ls
# what do you see?
# do you see the same things in your file explorer?
# do you have other folders listed? you can list the contents
# of those folders too by entering the relative path to those folder
ls foldername
# replace foldername with the name of a folder you can see when you
# enter ls
# what do you see?
# can you go to that folder in the file explorer? Do you see the same thing
# ls can list files in differnet ways. You can
# ls -l to see file permissions and the last date it was changed
# try that now
ls -l
# what do you see? You might also see this information in your File explorer
# let's try cd again
# rember we use cd to change directories
# now that you know what directories are near you let's cd into one
cd foldernameofyourchoice
# now let's see what is in that folder
ls
# what do you see? Is it the same as what you see in file explorer?
# let's see what the path is to where we are right now
pwd
# what do you see? is it what you expected?
# let's go back to the desktop
# use cd to try to go there.
# but let's stop by the "home" directory first
# the home directory is where your computer thinks your files start.
# it is a folder on your computer with your user name
cd ~
# to go to the home
ls
# see what is there? Documents is in there. Windows users will be familiar with
# that folder
# now let's go to the Desktop
cd Desktop
ls
# we see what is there
# and now we can try creating folders and files