当前位置:网站首页>Differences and basic operations of shell/sh/bash
Differences and basic operations of shell/sh/bash
2022-07-23 11:14:00 【I'm a girl, I don't program yuan】
shell/sh/bash The difference and connection
shell
shell yes “ Provide the user with the operation interface ” Software for (command interpreter, Command parser ), It also refers to the programming language used in the command parser .
shell The role of : User input instructions , adopt Shell Communicate with the kernel , The control hardware works normally
sh
shell Include There are many kinds of , The most commonly used are Bourne shell (sh), C shell (csh), and Korn shell (ksh).
Bourne shell (sh) yes UNIX Originally used shell , In every UNIX You can use .Bourne shell stay shell Very good at programming , But it is not as good as others in dealing with the interaction with users shell.
bash
Bourne Again shell (bash) yes sh An extension of , stay Bourne shell On the basis of the addition and enhancement of many features .bash It also includes a lot of C and Korn shell Advantages in .bash It has a very flexible and powerful programming interface , At the same time, it has a very friendly user interface .
Bourne shell The biggest drawback is that it handles user input . stay Bourne shell Typing commands can be cumbersome , and bash Make command input easier .
mac The terminal on the uses bash.
bash Common commands
- cd: Enter a directory
cd ~: Enter the user directory
cd …: Return to the upper directory
cd …/…/ Return to the upper directory - ls: Show All folders and files of this layer directory
- Command Completion function : Press twice in a row tab key , Show all commands that begin with some letters ; Press once tab key , Select the command that begins with the letter in the order of all commands .
- ./FileName: Read and execute FileName The command
Such as running script files ( The first line of the file must be :#!/bin/sh):
Entry directory →./start.sh( If you are prompted that permission is denied :chmod 764 start.sh→./start.sh) - source FileName: It is usually used to execute the newly modified initialization document
- vi/vim: Edit the file
i: Enter insertion mode ;esc: Enter command mode ;
English colon +wq: Save and exit ; English colon +q!: Do not save and exit - echo: Output
- export: Display or set environment variables
Set the environment variable :vim ~./bashrc(or other files)→export path="/your path:$PATH"→source ~/.bashrc(or other files) - Variable assignment :SPARK_STABLE=/opt/tiger/spark_deploy/spark-stable, No declaration required
Variable usage :${SPARK_STABLE}/bin/spark-submit - REPO_ROOT: General set to pwd( root directory ),PYTHONPATH: Directory of imported packages , Add the package directory after the default value
- ctrl+c: Closing order , return Input status
- mkdir file: newly build Folder ;rm file: Delete file
- Compress and decompress : decompression :tar -xf file name . Extension
- ssh: Used to encrypt when the client logs in to the server , It can also authenticate and authorize the operator .
logon server :ssh hostname→ Enter the password of the account → Sign in
边栏推荐
- USCD行人异常数据集使用指南 | 快速下载
- Markdown常用语法记录
- 【文献调研】在Pubmed上搜索特定影响因子期刊上的论文
- 给图片人脸部分加上马赛克
- Summary of common commands of vim
- Activiti工作流使用之新建bpmn文件
- SPR:SUPERVISED PERSONALIZED RANKING BASED ON PRIOR KNOWLEDGE FOR RECOMMENDATION
- IMG tag settings height and width are invalid
- systemctl-service服务添加环境变量及模板
- Markdown common syntax records
猜你喜欢

Fundamentals of software testing - design method of test cases

Web server failed to start. Port 8080 was already in use.

从零开始的pytorch小白使用指北

视、音频分开的网站内容如何合并?批量下载代码又该如何编写?

【Anaconda 环境管理与包管理】

【无标题】

MySQL statement queries all child nodes of a level node

JDBC database connection pool

cuda10.0配置pytorch1.7.0+monai0.9.0

JDBC数据库连接池
随机推荐
【无标题】
項目部署(簡版)
Web server failed to start. Port 8080 was already in use.
【无标题】
JS, pay attention to passing parameters. If it is a string, you need to add escape characters
Install pyGame using CMD
大米商城注册
Copy a project /project in idea
Fundamentals of software testing - design method of test cases
MySQL statement queries all child nodes of a level node
img标签设置height和width无效
Hyperlink de underlined code
DWI图像 从DICOM Tag识别 b value 的方法
When using cache in sprintboot, the data cannot be loaded
防止神经网络过拟合的五种方法
2.启动函数返回值的剖析
Gerrit 使用操作手册
机器学习中的矩阵向量求导
使用cmd安装pygame
JDBC数据库连接池