First lecture
What we'll cover
General course
Literature
Literature - The internet
What is a program?
How to get inside your computer
What is a program?
What is a program?
What is a program?
What is a program?
What is programming?
Repeatability
Faster
Automation
Elements of Style
Languages!
Languages!
Languages!
Languages!
Languages!
Why Python?
Why Python?
Why Python?
Why Python?
Why Unix?
Why Unix?
Why Unix?
Why Unix?
A taste of Unix
A taste of Unix
File systems
File systems
File systems
File systems
A note on backups
File path
File path
File path
A few important paths
Here | . |
One level up | .. |
Home | ~ or $HOME |
Root | / |
.. and . -----> "relative paths"
~ or /usr/bin -----> "absolute paths"
Commands for Getting Around
1.) Common commands
2.) Working on files
3.) Stringing them together
nano
Commands for Getting Around
cd | Change Directory |
mkdir | make directory |
ls | List |
rm | Remove |
pwd | Print working directory |
man | Manual |
Commands for Getting Around
cd | cd : takes you home cd .. : takes you up one level (to the containing directory) |
mkdir | mkdir filename |
ls | ls -a : shows hidden files ls -l : shows files along with sizes and timestamps |
rm | rm -r : remove recursively rmdir: remove directory **CAUTION** with power comes danger! |
Getting Comfortable
tab | Auto complete |
* | Wildcard |
Up arrow | Last command |
Ctrl + C | Escape process |
Ctrl + L | Clear screen |
Getting Comfortable
tab | Enter enough unique characters and press tab. This will complete the filepath or command. |
* | Matches every character in a filename. |
File operations
grep | print line with matching plain text string |
cat | Concatenate, stream to "standard out" |
head/tail | Print the first or last lines in file |
| | Send output of one command or program to another as input |
wc | Word count |
cp and mv | Copy and move |
File operations
grep | grep word filename |
cat | cat file1 |
head/tail | head -n1 file1 tail -n4 file1 |
| | ls -l | wc -l |
wc | wc -l counts number of lines wc filename counts the words in the file |
cp and mv | cp file folder makes a copy of a file into a folder mv file folder moves that file, leaving no copy |
File operations
**Looking at the manual for all the commands we are showing you is worth your while. Typing 'man command name' will show the manual file
Or just Google it!
Redirection
Tasks
Bonus task