欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

能运行shell吗_terminal, shell, bash, zsh

发布时间:2023/12/20 编程问答 57 豆豆
生活随笔 收集整理的这篇文章主要介绍了 能运行shell吗_terminal, shell, bash, zsh 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

##秋天的第一杯奶茶梗?

Terminal:

shell运行在里面。A terminal refers to a wrapper program that runs a shell.

Shell:

The shell is the program that actually processes commands and returns outputs.

Most shells also manage foreground and background processes, command history, and command-line editing. These features are standard in bash, the most common shell in modern Linux systems.

shell 是一个命令行解释器,是人机交互的端口。

用户输入一条命令,shell 就立即解释执行一条(interactive)。

  • 编译器: 输入A语言的源代码,输出是B语言;如C++,被编译成汇编语言;
  • 解释器:输入A语言的源代码,直接执行A语言;可以理解为“编译器+机器,编译器把输入语言编译成中间语言,然后机器执行。

Command: 在黑框框里输入的命令--> command-line interface (CLI);

GUI: 在屏幕上戳戳-->graphical user interface (GUI)

shell类型

常见的 shell 解释器有 sh、bash这两种,其他有 ksh、csh 和 zsh。

一门语言有解释器,就可以作为 shell 使用。比如Java 有第三方解释器 Jshell,PHP有 PHP Shell。windows有 windows shell( command interpreter)

Bash

Bash 是最常见的 shell。
唤醒 bash shell 时方式不同,加载不同文件:

login shell 加载 ~/.bash_profile

non-login shell 加载 ~/.bashrc 。

zsh

zsh兼容 bash,还有自动补全等功能

zsh 的配置文件~/.zshrc

配置 shell

shell 在启动时都会去找配置文件,然后运行它。

你安装的一些脚本,如果想让它能够全局运行,就需要在配置文件中设置路径。

有过设置路径后还是不管用的经历吗?多半是因为把配置写在了错误的配置文件里。* 应该在配置shell(最常见的是配置默认命令)之前,使用 echo $SHELL,确认自己现在用的是什么shell后,再去编辑对应的配置文件 *

Console:

能输入命令的界面. 比如Chrome中的console可以输入JavaScript;

Shell也是种console但只能输入Linux command

Python & IPython:

Python is a high-level general-purpose programming language.

IPython is an interactive shell that is built with python.

IDE:

An integrated development environment(IDE) is software for building applications that combines common developer tools into a single graphical user interface (GUI)

  • Python IDE: Pycharm, Jupyter, Spider

PyCharm is an IDE developed by JetBrain, the team responsible for one of the most famous Java IDE.

Anaconda is a package manager.

总结

以上是生活随笔为你收集整理的能运行shell吗_terminal, shell, bash, zsh的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。