Week03 - ULI101 Week 03 Week Overview Absolute and relative...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
ULI101 Week 03
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Week Overview Absolute and relative pathnames File name expansion Shell basics Command execution in detail Recalling and editing previous commands Quoting
Background image of page 2
Pathnames A pathname is a list of names that will lead to a file. Essentially they are directories, but a file name itself is a path as well The concept of a pathname relates to every operating system including Unix, Linux, MS-DOS, MS-Windows, Apple-Macintosh, etc.! Examples: Directory pathname: /home/username/ics124/assignments/ File pathname: /home/username/ops224/assignments/assn1.txt
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Absolute vs Relative Pathnames Absolute Pathname A pathname that begins from root. The pathname begins with a forward slash eg. /home/someuser/unx122 Relative Pathname A pathname that is "relative" to the location of the current or "working" directory. For example, if we are in your home directory, issuing the command mkdir uli101 will create the uli101 directory in your home directory!
Background image of page 4
Relative Pathnames Rules: A relative pathname does NOT begin with a slash. Following symbols can be used at the beginning: .. parent directory (up one directory level) . current directory Not all relative pathnames begin with “. .”! Warning: When using relative pathname, always make certain you know your present working directory!
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Relative Pathnames Examples: Change to another directory branch from parent directory: cd . ./ipc144 copy sample.c file from joe.professor's directory to your current directory : cp . ./joe.professor/uli101/sample.c .
Background image of page 6
Relative-to-Home Pathnames You can specify a pathname as relative-to-home by using a tilde and slash at the start, e.g., ~/uli101/notes.html The tilde ~ is replaced by your home directory (typically /home/ your.account /) to make the pathname absolute. You can immediately place a username after the tilde to represent another user’s home directory. For example: ~jane.somebody = /home/jane.somebody but ~ = /home/your_home_dir
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Which Type of Pathname to Use? So far, we have been given many different types of pathnames that we can use for regular files and directories: Absolute pathname (starts with / ) Relative pathname (doesn’t start with /) Relative-to-home pathname (starts with ~) You can decide which pathname type to use to make it more convenient (eg relative – usually less typing or absolute if you don’t know what directory you are currently located in…)
Background image of page 8
Making Directories Building directories is similar in approach to building a house Begins from a foundation (eg home directory). Need to build in proper order (add on addition to
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 28

Week03 - ULI101 Week 03 Week Overview Absolute and relative...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online