📄 shell.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head> <title></title> <link rel="stylesheet" media="screen" type="text/css" href="./style.css" /> <link rel="stylesheet" media="screen" type="text/css" href="./design.css" /> <link rel="stylesheet" media="print" type="text/css" href="./print.css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><a href=start.html>start</a></br><div class="toc"><div class="tocheader toctoggle" id="toc__header">Table of Contents</div><div id="toc__inside"><ul class="toc"><li class="level1"><div class="li"><span class="li"><a href="#customizing_the_shell_environment" class="toc">Customizing The Shell Environment</a></span></div><ul class="toc"><li class="clear"><ul class="toc"><li class="level3"><div class="li"><span class="li"><a href="#launching_a_login_shell" class="toc">Launching a Login Shell</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#example_shell_variables" class="toc">Example Shell Variables</a></span></div></li></ul></li></ul></li></ul></div></div><h1><a name="customizing_the_shell_environment" id="customizing_the_shell_environment">Customizing The Shell Environment</a></h1><div class="level1"><p> Login shells will automatically read the files <code>/etc/profile</code> and <code>$HOME/.profile</code> when they first run. This allows you to setup the environment of your shell when it first launches.</p></div><!-- SECTION [1-238] --><h3><a name="launching_a_login_shell" id="launching_a_login_shell">Launching a Login Shell</a></h3><div class="level3"><p> To launch a login shell, edit your <code>/etc/inittab</code> file and add a line like:</p><pre class="code">console::askfirst:-/bin/sh</pre><p> The key part here is the ‘-’ at the beginning of the path.</p></div><!-- SECTION [239-441] --><h3><a name="example_shell_variables" id="example_shell_variables">Example Shell Variables</a></h3><div class="level3"></div><h5><a name="ps1" id="ps1">PS1</a></h5><div class="level5"><p> This variable allows you to customize the shell prompt (assuming you have fancy shell prompt support enabled). The default value is:</p><pre class="code">PS1='\u:\w> '</pre><p> Some other fun values:</p><ul><li class="level1"><div class="li"> \u - username</div></li><li class="level1"><div class="li"> \h - hostname</div></li><li class="level1"><div class="li"> $ - # for root, $ for non-root</div></li><li class="level1"><div class="li"> \w - working directory, replace $HOME with ‘~’</div></li><li class="level1"><div class="li"> \W - working directory</div></li><li class="level1"><div class="li"> \e - <acronym title="American Standard Code for Information Interchange">ASCII</acronym> escape \033</div></li><li class="level1"><div class="li"> \[ - start non-printable sequence</div></li><li class="level1"><div class="li"> \] - end non-printable sequence</div></li></ul></div><h5><a name="path" id="path">PATH</a></h5><div class="level5"><p> Store custom binaries in your own directory and just add it to your PATH:</p><pre class="code">PATH=$PATH:/usr/local/your/place</pre></div><!-- SECTION [442-] --></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -