BINF 511 Lecture Notes - Lecture 2: Oden, Terminal Emulator, Uniq

78 views5 pages
Lecture 2A: Basic Unix skills
January 17, 2018
Operating system
oMakes the machine work
oEnables you to talk to the machine
oEx: DOS (PCs), Mac OS, Unix
Unix operating system
oFor large, multi user systems
oUnix is the world wide web -> how the computer communicates
oDifferent versions
Commercial (e.g.)
IRIS (Silicon Graphics)
SOLARIS (SUN Microsystems)
OS X (Apple)
Open source
Linux
File systems
oA file is a physical location written on a disc
oIt can be read and manipulated if we can locate it
oDirectories are "containers" for groups of files
Directories can also be treated as files
Human-readable vs. machine-readable files
oHuman readable = text files
oMachine readable = binary files
E.g. image files, word docs, etc.
Directory structures
oConsistency in directories is the best way to find your files efficiently
oHierarchy structure
You'll automatically be in your home directory
Then you'll have the subdirectories
oTo find files
We need to navigate through the system and find files
To describe the location of files we use paths
oRoot
Written as /
The beginning of the directory system
The parent of all subdirectories
Very important to keep track of
oWorking directory
"Where you are"
oAbsolute path
Relative to root (always from root)
End with a / to denote that the last item is also a directory
oRelative path
You don't have to go from root
../../ -> two dots = go back to the directory that is one up from the current
directory
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows pages 1-2 of the document.
Unlock all 5 pages and 3 million more documents.

Already have an account? Log in
The prompt
oThe machine is waiting for you to give it commands
oEx: hugin:~ stromvik%
The first word = name of the computer
Tilde means "my home directory"
This is who I am logged in as
The prompt at the end can be different characters
Prompt characters: %, $, >
Commands to navigate
opwd = print working directory = where am I?
ols = list (similar to "dir" in some systems)
Default is listing working directory
Can sepcify which dir to list
ols -l = list long = make a long list of my files, tell me more information for my file
Always have to leave a space after a command
The first few characters = permissions (read/write/execute)
Permissions for 3 groups of people: owner, group, world
R = read = 4
W = write = 2
X = execute (for e.g. scripts) = 1
Add up to 7 = can do everything
Add up to 6 = can read and write, but not execute
Add up to 4 = 4 can only read
777 means everybody can do anything
644 means the owner can read and write to file, group and world can
read
Ex: -rw-r--r--
644 -> 6 for the owner, 4 for group, 4 for world
Because the example didn't start with "d", this is not a directory
chmod = change the permissions on a file (aka mode)
Ex: chmod 777 mytestfile.txt
ocd = change directory
The default is change to home directory
Only typing "cd" will bring you directly to home
owhoami = print username
ocp file newlocation = copy a file
omv file file2 = rename a file
omv file new_dir/ = move a file to a new location
omkdir new_dir/ = create a new directory
orm file2 = remove a file -> be very careful.. once it's gone, it's gone
orm -r -> the "r" means recursive, it's going to delete everything in the subdirectories
File system naming conventions
oName directories and files consistently
oCannot have spaces or special characters in your filenames
oIf you want to, use underscores or periods
How to use a command?
oCheck "man" pages for manual
Ex: man ls -> will give you directions for what to do with "ls"
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows pages 1-2 of the document.
Unlock all 5 pages and 3 million more documents.

Already have an account? Log in

Document Summary

Operating system: makes the machine work o o. For large, multi user systems: unix is the world wide web -> how the computer communicates, different versions. File systems: a file is a physical location written on a disc o. It can be read and manipulated if we can locate it: directories are containers for groups of files. Human-readable vs. machine-readable files: human readable = text files, machine readable = binary files. Consistency in directories is the best way to find your files efficiently: hierarchy structure. We need to navigate through the system and find files. To describe the location of files we use paths o. Very important to keep track of: working directory. End with a / to denote that the last item is also a directory o. // -> two dots = go back to the directory that is one up from the current directory. The machine is waiting for you to give it commands.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents