Changes

Jump to: navigation, search

OPS705 Lab 2 (2227)

781 bytes added, 17:24, 20 September 2022
Adds relative-to-home key concepts.
==== Absolute Pathnames ====
An '''absolute pathname''' is a path to a file or directory '''always beginning from the root directory''' (i.e. '''<code>/'''</code>).
This type of pathname is referred to as '''absolute''' because the pathname always begins from the '''root directory''', ''regardless the location or your current directory''. In other words, this type of pathname requires that you always provide the '''FULL''' pathname starting with the root directory.
* <code>ls examples</code>
* <code>ls ./examples</code>
 
==== Relative-to-Home Pathnames ====
A '''relative-to-home''' pathname begins with the tilde character ( i.e. '''~''') to represent the user’s home directory.
 
The tilde character <code>~</code> stores the path of the user’s home directory (i.e. '''~''' = '''/home/current-user-id''')
 
You can immediately place a username after the tilde to represent another user’s home directory (e.g. '''~cjohnson30''' = '''/home/cjohnson30''')
 
Examples:
* <code>ls ~/uli101/examples</code>
* <code>ls ~cjohnson30/uli101/notes</code>
 
'''NOTE''': Deciding which '''type of pathname''' to use depends on many factors including:
# Knowledge of current directory
# Knowledge of directory structure
# Currently directory location
# Type of file management command that is being used
= INVESTIGATION 1: Creating and Managing Directories =

Navigation menu