CSE 391
Syllabus
Introduction to Linux
Slides created by Josh Ervin. Based off slides made by Marty Stepp, Jessica Miller, Ruth Anderson, Brett Wortzman, and Zorah Fung
COURSE STAFF
Lecturer: Ryan Maas
TA: Wei (Ellen) Wu
COURSE TOPICS
AGENDA
COURSE INTRODUCTION
ASSESSMENT
DISCUSSION BOARD
REMOTE LEARNING
ACCESSING LINUX/UNIX
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)
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 |