“Where are we?” “Loveland.”
“Where’s that?” “Colorado.”
“Where’s that?” “The USA.”
“Where’s that?” “Earth.”
“Where’s that?” “The Solar System.”
“Where’s that?” “The Milky Way.”
“Where’s that?” “You’re not from around here, are you?”
“Where are we?”
“Loveland, Colorado, USA, Earth, Solar System, Milky Way.”
“I wanted it in the other order.”
“Milky Way, Solar System, Earth, USA, Colorado, Loveland.”
As a Unix path:
/MilkyWay/SolarSystem/Earth/USA/Colorado/Loveland
What if you’re not dealing with an idiot? Then you only need to specify as much as you need.
English: “I’m from Loveland, Colorado.”
Linux: Colorado/Loveland
Note that Colorado/Loveland
did not start with a slash.
/s/parsons/d/fac/applin/monster
A pathname, or path is the “route” to a file or directory. How long is a route? It depends where you are, relative to the target.
/
or ~
.
.
(dot) means the current directory
..
(dot dot) means the parent directory
% pwd /s/chopin/k/grad/nate % cd /s % pwd /s % ls bach chopin parsons preisner
pwd
: print working directory
ls
: list directory
cd
: change directory
more
: view a file
Options can modify behavior.
% ls bach chopin parsons % ls -F bach/ chopin/ parsons/ % ls chopin a k % ls -l chopin total 8 drwxr-xr-x 5 root root 4096 Jan 17 02:01 a drwxr-xr-x 5 root root 4096 Jan 17 02:16 k
ls
as an example
-l
: use a long listing format -S
: sort by file size
-F
: Put /
after directories, and *
after programs.
Also, there’s ll
(that’s ell-ell, not eleven), which is same as
ls -l
. It’s a non-portable alias, which we will discuss later.
Modified: 2017-08-17T15:34 User: Guest Check: HTML CSSEdit History Source |
Apply to CSU |
Contact CSU |
Disclaimer |
Equal Opportunity Colorado State University, Fort Collins, CO 80523 USA © 2015 Colorado State University |