Lecture Notes
CSE 391
Week 2
- Most of the tools will be in Linux and *nix systmes.
- Knowing that tools exist can help you navigate projects.
- Unix - initially developed in 1970 at Bell Labs; many of these key ideas are still used today.
- Everything is a file
- Hierarchical file systems
- Multiple users
- Input / output streams
- macOS is a disguised unix OS.
- Linux vs Shell - shell is an interactive program which allows the user to interact with the operating system.
- Why use shells over GUIs?
- Complicated tasks are easier on the command line
- Useful for remote servers
- Programmable
- Customizable
- Bash shell will be used in this class, but there are many others.
- One dot - current directory. Two dots - parent directory.
/queryto search, pressnto keep going.-awill show hidden files - things starting with a dot.touchwill create a file.
Week 3
- You can use
touchto change file timestamps and to create files. - Forward slash - helpful way to searcht rogh file.
- Sort
- Redirect into outputs with
>
Week 4
uniqonly removes duplicates when they’re next to each other - make sure to pipe throughsortbeforeuniq.- Command substitution
stdout | tee name.txtprints out and to a file.cut- accept delimeter and field (one-indexed)
Week 5
git statuskeeps you updated on the state of the repository.- If you’re not in a git repo, you’re going to get a fatal error.
git addandgit stagedo the same thing.git add .adds everything.
git diff- show differences.git diff --staged, shows differences between current repository and the local staging area
- When you commit, you only commit to your local repository.
git commit -m "...".- Alternative: just typing
git commitopens up the default text editor where you can type a more in-depth message. - When completed, save and quit.
- Alternative: just typing
git statusis focused on tracking files,git logis focused on tracking commits.git diff --staged
Week 6
git blame- CI - continuous integration.
- Younger commits must point to the parent.
Week 7
git switch- change which branch you are ongrep -Ecan be used to search for regular expressions
Week 8
- SED - stream editor
-rto use regular expressions.\s- any whitespace (space or tab)