CSE 391
Syllabus
Introduction to Linux
Slides created by Josh Ervin and Hunter Schafer. �Based off slides made by Marty Stepp, Jessica Miller, Ruth Anderson, Brett Wortzman, and Zorah Fung
Now Playing: Sharou
Before class: Say hi to your neighbor! Introduce yourself and something you’re excited about for this quarter!
AGENDA
COURSE INTRODUCTION
ASSESSMENT
DISCUSSION BOARD
COURSE STAFF
Instructor: Hunter Schafer
TA: Evan Hao
CLASS STRUCTURE
How many points are necessary to earn credit for this course? Enter a number.
14 (out of 20 possible)
ACCESSING LINUX/UNIX
There are so many options available out there since Linux is all over the place! However, we do not guarantee any support for using Linux outside of these provided options.
COURSE TOPICS
A BRIEF HISTORY OF LINUX AND UNIX
THE SHELL
BASIC SHELL COMMANDS
command | description |
pwd | Print current working directory |
cd | Change working directory |
ls | List files in working directory |
man | Bring up manual for a command |
exit | Log out of shell |
SYSTEM COMMANDS
command | description |
clear | Clears all output from console |
date | Output the system date |
cal | Output a text calendar |
uname | Print information about the current system |
RELATIVE DIRECTORIES
directory | description |
. | References the working directory |
.. | References the parent of working directory |
~username | username’s home directory |
~/Desktop | Your desktop |
UNIX FILE SYSTEM
directory | description |
/ | Root directory that contains all directories |
/bin | Applications/programs (i.e. binaries) |
/dev | Hardware devices |
/etc | Configuration files |
/home | Contains user’s home directories |
/proc | Running programs (processes) |
/tmp, /var | Temporary files |
/usr | Universal system resources |
DIRECTORY COMMANDS
directory | description |
ls | List files in working directory |
pwd | Print current working directory |
cd | Change working directory |
mkdir | Make a new directory |
rmdir | Remove the given directory (must be empty) |
COMMAND LINE ARGUMENTS
$ ls -al dir1
Command
Flags
Arguments
(Parameters)
Assume you are currently in the lecture1 directory. How could you list all of the files in dir1 (including hidden files) such that you get all of the long-form information in human-readable format.
Hint: Check the man pages to see what human-readable might mean!
ls -lah dir1
COMMAND LINE ARGUMENTS
FILE COMMANDS
directory | description |
cp | Copy a file |
mv | Move a file (also used to rename files) |
rm | Remove the given file |
touch | Create empty file, or change time-modified |
TEXT EDITORS
command | description |
nano | Very simple editor |
vim | More advanced text-editor |
emacs | More advanced text-editor |
VIM BASICS
Key stroke | description |
:w | Write (save) the current file |
:wq | Write (save) the current file and exit |
:q! | Quit, ignoring all changes |
i | Go into insert mode |
Esc | Go back to normal mode |
hjkl | Move cursor left, down, up, right |
u | Undo last change |
x | Delete character |
EMACS BASICS
C = control key
M = alt/meta key
Key stroke | description |
C-x C-f | Read a file into emacs |
C-x C-s | Save a file to disk |
C-x C-c | Exit emacs |
C-s | Search forward |
C-r | Search backwards |
C-v | Scroll to next screen |
M-v | Scroll to previous screen |
C-x u | Undu |
Can a program write code?
We need YOU!
Reasons to join
Requirements
Give executable permission for all *.sh files in dir/
find /dir/ -type f -name "*.sh" -exec chmod +x {} \;
Questions? @Thomas Schweizer on
Interested? http://bit.ly/en2bash-signup
Sign-up with this link by April 1st