52 lines
1.4 KiB
HTML
52 lines
1.4 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
<html>
|
|
<head>
|
|
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
|
<meta http-equiv="Content-Type" content=
|
|
"text/html; charset=utf-8">
|
|
<title>Tilde expansions</title>
|
|
<LINK rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
|
</HEAD>
|
|
<body bgcolor="#FFFFFF">
|
|
<!-- Java sync-link -->
|
|
<SCRIPT LANGUAGE="Javascript" SRC="../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
|
|
|
|
|
|
|
|
<h2>Tilde expansions</h2>
|
|
|
|
<p>
|
|
An unquoted tilde character (<strong>~</strong>) at the
|
|
beginning of a word is expanded according to the following rules:
|
|
<ul>
|
|
<li><strong>~</strong> expands to the value of the <strong>HOME</strong>
|
|
variable (the current user's home directory).</li>
|
|
<li><strong>~user</strong> expands to the home directory of the specified user. All
|
|
the characters up to a slash (<strong>/</strong>) or the end of the
|
|
word are treated as a user name.</li>
|
|
<li><strong>~+</strong> expands to the value of the <strong>PWD</strong>
|
|
(working directory) variable.</li>
|
|
<li><strong>~-</strong> expands to the value of the <strong>OLDPWD</strong>
|
|
(previous working directory) variable if it is set.</li>
|
|
</ul>
|
|
|
|
<p><strong>Examples</strong></p>
|
|
|
|
<ol>
|
|
<li>Change the current directory to the user's home directory:
|
|
<pre>
|
|
cd ~
|
|
</pre>
|
|
</li>
|
|
|
|
<li>Change the current directory to the bin directory in user smith's home directory:
|
|
<pre>
|
|
cd ~smith/bin
|
|
</pre>
|
|
</li>
|
|
</ol>
|
|
|
|
|
|
</body>
|
|
</html>
|