Difference between revisions of "Advanced Problems"
Jump to navigation
Jump to search
(→Vars) |
|||
Line 1: | Line 1: | ||
==Navigating== | ==Navigating== | ||
− | /, | + | === Commands === |
+ | cd = change directory | ||
+ | ls = list directory contents | ||
+ | |||
+ | === Abreviations === | ||
+ | / = the root directory | ||
+ | .. = the parent directory | ||
+ | ~ = your home directory | ||
+ | - = the last directory you were in (not used in paths) | ||
+ | |||
+ | === Quiz === | ||
+ | # How would you change to the root directory? | ||
+ | ## How would you change back to your home directory? | ||
+ | |||
+ | == Variables == | ||
+ | === Assignment and Dereferencing === | ||
+ | To assign a value to an environment variable you simply type the variable name, '=', then the value. For example, | ||
+ | FOO=Rob | ||
+ | BAR=Love | ||
+ | |||
+ | To get the value of the variable (i.e. dereference) you place a '$' before the variable name. | ||
+ | |||
+ | #echo $FOO | ||
+ | #Rob | ||
+ | #echo $BAR | ||
+ | #Love | ||
+ | |||
+ | === Commands === | ||
+ | env = Shows you the environment variables that are currently defined. | ||
+ | echo = Displays a line of text. | ||
+ | |||
+ | === Quiz === | ||
+ | # What is the value of the "HOME" environment variable? | ||
+ | # How would you create an environment variable named GEEK that's contents are "FREE GEEK is the best!"? | ||
− | |||
− | |||
− | |||
− | |||
==Piping== | ==Piping== | ||
Line 21: | Line 50: | ||
* show studnets that they can have root in our current ltsp setup. | * show studnets that they can have root in our current ltsp setup. | ||
* add the ability to have debian livecd over the net - or something like that. | * add the ability to have debian livecd over the net - or something like that. | ||
+ | |||
+ | ==Advanced Syntax== | ||
+ | *, --sort, &c. | ||
+ | |||
[[Category:Classes]] | [[Category:Classes]] |
Revision as of 12:21, 23 February 2008
Commands
cd = change directory ls = list directory contents
Abreviations
/ = the root directory .. = the parent directory ~ = your home directory - = the last directory you were in (not used in paths)
Quiz
- How would you change to the root directory?
- How would you change back to your home directory?
Variables
Assignment and Dereferencing
To assign a value to an environment variable you simply type the variable name, '=', then the value. For example,
FOO=Rob BAR=Love
To get the value of the variable (i.e. dereference) you place a '$' before the variable name.
#echo $FOO #Rob #echo $BAR #Love
Commands
env = Shows you the environment variables that are currently defined. echo = Displays a line of text.
Quiz
- What is the value of the "HOME" environment variable?
- How would you create an environment variable named GEEK that's contents are "FREE GEEK is the best!"?
Piping
grep, less, wc, cat, multiple files, lsof, xargs, find, sort, awk
Networking
ifconfig, ping, wget, traceroute
While/For
write, touch
Apt
can we set up a xen instance to let students have root?
- show studnets that they can have root in our current ltsp setup.
- add the ability to have debian livecd over the net - or something like that.
Advanced Syntax
- , --sort, &c.