没有csh或tcsh?

use*_*662 9 command-line tcsh csh

在 /bin 中,我看到 bash,但没有看到 csh 或 tcsh。当我在我的主目录中创建一个“.cshrc”文件时,它没有效果;这就是我发现这个问题的方式。

所以问题是:如何切换到 csh/tcsh 类型的登录?

谢谢你的帮助。

Rin*_*ind 15

与 Ubuntu 中的任何软件一样,您需要安装它:

sudo apt-get install csh
Run Code Online (Sandbox Code Playgroud)

您可以csh在命令行上使用它来启动它。

tcsh(在宇宙中)相同:

sudo apt-get install tcsh
Run Code Online (Sandbox Code Playgroud)

您可以tcsh在命令行上使用它来启动它。

顺便说一句,如果您csh在命令行中输入,您会看到:

csh
The program 'csh' can be found in the following packages:
 * csh
 * tcsh
Try: sudo apt-get install <selected package>
Run Code Online (Sandbox Code Playgroud)

Ubuntu.com维基解释如何永久切换:

更改永久登录外壳

您将使用一个名为 chsh 的程序。有交互式方法和非交互式方法。将其输入到您的终端中。

交互式方法

chsh
Run Code Online (Sandbox Code Playgroud)

这会产生一个简短的对话框,其中首先提示用户输入其密码,然后是所需新 shell 的完整路径。

更改默认 shell 时应谨慎行事,因为可能会出现只有 root 用户(即系统管理员)才能修复的错误(尽管熟练用户在家庭系统上修复它应该很容易)。尤其重要的是,首先在当前会话中临时测试 shell,然后确保在进行永久更改时输入了有效的 shell 名称。

非交互方法

我将再次使用 csh 作为示例。

chsh -s /bin/csh
Run Code Online (Sandbox Code Playgroud)

-s 为您设置它,而无需进入编辑器进行设置。

好的,你执行了命令,一切顺利。但回声说它是一样的。注销并返回以使更改生效。然后执行 echo $SHELL。您应该会看到它显示了新的外壳。


Flo*_*sch 5

安装tcsh

sudo apt-get install tcsh
Run Code Online (Sandbox Code Playgroud)

设置tcsh为您的登录 shell:

chsh -s /bin/tcsh
Run Code Online (Sandbox Code Playgroud)

在您下次登录tcsh后将用作您的交互式 shell。