User Tools

Site Tools


unix week3



Tutors: Rana TR 12:30-5:00 CHM123
MW 12:30-2:20 CHM125

Ben MWF 1-3 Learning Commons


Got some games here: '/usr/games'

Some Commands and things:

'write (name [tty])' send a message
'mesg (y/n)' to turn messages on or off for your terminal
'status (classname) [detail]' used to show info about your classes and scores
\ toggles the meaning of the next character (like with enter to continue the command line)

Unix Quotes: “ ” half quotes variable expansion
' ' full qotes literal quote, NO expansion
` ` or $() back quotes command expansion

They are unique to the terminal

Setting (declaring)
no ^ spaces around it

Expand (access)
example: echo “name's value is ${name}”

Command expansion [` `] allows commands to be stored in variables or called directly in a line
example: echo “there are `usr/bin/who | wc -l` users online”

? match 1 of any character
* match 0 or more of any character
[ ] match 1 of any enclosed characters (character class)
[^ ] do not match 1 of any of enclosed characters (inverted character class)

? examples:
ls ??? (Lists all files 3 characters long)
ls c?? (Lists all 3 letter files starting with c)

* examples:
ls c* (Lists all files that start with c)
ls *c* (Lists all files with a c in them)

[] examples:
ls [ct]* (Lists all files starting with c or t)
ls [c-h]??? (Lists all files starting with c through h that are 4 characters long)

[^ ] example:
ls [^aeiou]* (Lists all files that don't start with a vowel

journal/spring2019/bmather2/week3.txt · Last modified: 2019/02/05 16:05 by bmather2