Open main menu

CDOT Wiki β

Changes

ULI101 Week 3

85 bytes added, 21:30, 4 September 2019
no edit summary
<li><p>Not all relative pathnames begin with <code>..</code></p></li>
<li><p>When using relative pathname, make sure you know your present working directory.</p>
<source lang="bash"># Change pwd to another directory branch from ipc144 (.. means parent directory: of pwd)cd../ipc144
# copy file sample.c file (location is relative to parent of pwd) # from joe.professordoe's home directory to your current directory:pwd (. means pwd)cp ../joe.professor/uli101doe/sample.c .
</source></li></ol>
= Relative-to-Home Pathnames =
=== You can specify a pathname as relative-to-home by using a tilde and slash at the start, e.g. <code>~/uli101/notes.html</code> === === . 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: ===
* <code>~jane.somebody</code> expands to <code>/home/jane.somebody</code> but <code>~</code> expands to <code>/home/your_home_dir</code>
| quote a group of characters
|-
| Backslash quote (<code>\</code>)
| quote the one character immediately following the backslash
|}
$ echo \*
</source>
* To quote a <code>\</code> another another <code>\\</code> is used, this means <code>\\</code>
== ' ' Quotes ==
</source>
== Double Quoting ==
* Commands such as echo can have their arguments quoted using double quotes
* Prevent shell variable substitution
* Stop escape characters interpretation
 
[[Category:ULI101]]
[[Category:ULI101-2018]]