当前位置:首页 » 操作系统 » 什么是linuxshell

什么是linuxshell

发布时间: 2022-04-05 02:03:11

linux shell区别

这两种方法没有区,都是在新建的子shell里执行这个shell

还有另外一种点语法 “ . shell脚本
点后面有个空格
这个是在当前的shell中执行该脚本

② Linux shell #* 是什么意思

这是 变量扩展表达式。
"#* " 是指从变量host中删除空格前面的所有字符
一下摘取自 bash manual

${parameter#word}
${parameter##word}
The word is expanded to proce a pattern just as in filename expansion (see section 3.5.8 Filename Expansion). If the pattern matches the beginning of the expanded value of parameter, then the result of the expansion is the expanded value of parameter with the shortest matching pattern (the `#' case) or the longest matching pattern (the `##' case) deleted. If parameter is `@' or `*', the pattern removal operation is applied to each positional parameter in turn, and the expansion is the resultant list. If parameter is an array variable subscripted with `@' or `*', the pattern removal operation is applied to each member of the array in turn, and the expansion is the resultant list.
${parameter%word}
${parameter%%word}
The word is expanded to proce a pattern just as in filename expansion. If the pattern matches a trailing portion of the expanded value of parameter, then the result of the expansion is the value of parameter with the shortest matching pattern (the `%' case) or the longest matching pattern (the `%%' case) deleted. If parameter is `@' or `*', the pattern removal operation is applied to each positional parameter in turn, and the expansion is the resultant list. If parameter is an array variable subscripted with `@' or `*', the pattern removal operation is applied to each member of the array in turn, and the expansion is the resultant list.
${parameter/pattern/string}
${parameter//pattern/string}

The pattern is expanded to proce a pattern just as in filename expansion. Parameter is expanded and the longest match of pattern against its value is replaced with string. In the first form, only the first match is replaced. The second form causes all matches of pattern to be replaced with string. If patternbegins with `#', it must match at the beginning of the expanded value of parameter. If pattern begins with `%', it must match at the end of the expanded value of parameter. If string is null, matches of pattern are deleted and the / following pattern may be omitted. If parameter is `@' or `*', the substitution operation is applied to each positional parameter in turn, and the expansion is the resultant list. If parameter is an array variable subscripted with `@' or `*', the substitution operation is applied to each member of the array in turn, and the expansion is the resultant list.

${parameter:-word}
If parameter is unset or null, the expansion of word is substituted. Otherwise, the value of parameter is substituted.
${parameter:=word}
If parameter is unset or null, the expansion of word is assigned to parameter. The value of parameter is then substituted. Positional parameters and special parameters may not be assigned to in this way.
${parameter:?word}
If parameter is null or unset, the expansion of word (or a message to that effect if word is not present) is written to the standard error and the shell, if it is not interactive, exits. Otherwise, the value of parameter is substituted.
${parameter:+word}
If parameter is null or unset, nothing is substituted, otherwise the expansion of word is substituted.
${parameter:offset}
${parameter:offset:length}
Expands to up to length characters of parameter starting at the character specified by offset. If length is omitted, expands to the substring of parameter starting at the character specified by offset. length and offset are arithmetic expressions (see section 6.5 Shell Arithmetic). This is referred to as Substring Expansion.

length must evaluate to a number greater than or equal to zero. If offset evaluates to a number less than zero, the value is used as an offset from the end of the value of parameter. If parameter is `@', the result is length positional parameters beginning at offset. If parameter is an array name indexed by `@' or`*', the result is the length members of the array beginning with ${parameter[offset]}. Substring indexing is zero-based unless the positional parameters are used, in which case the indexing starts at 1.
${!prefix*}
Expands to the names of variables whose names begin with prefix, separated by the first character of the IFS special variable.
${#parameter}
The length in characters of the expanded value of parameter is substituted. If parameter is `*' or `@', the value substituted is the number of positional parameters. If parameter is an array name subscripted by `*' or `@', the value substituted is the number of elements in the array.

③ linux中的shell究竟是什么

【一】
shell的含义:
首先shell的英文含义是“壳”;
它是相对于内核来说的,因为它是建议在核的基础上,面向于用户的一种表现形式,比如我们看到一个球,见到的是它的壳,而非核。
Linux中的shell,是指一个面向用户的命令接口,表现形式就是一个可以由用户录入的界面,这个界面也可以反馈运行信息;
【二】shell在Linux中的存在形式:
由于Linux不同于Windows,Linux是内核与界面分离的,它可以脱离图形界面而单独运行,同样也可以在内核的基础上运行图形化的桌面。
这样,在Linux系统中,就出现了两种shell表现形式,一种是在无图形界面下的终端运行环境下的shell,另一种是桌面上运行的类型Windows
的MS-DOS运行窗口,前者我们一般习惯性地简称为终端,后者一般直接称为shell
【三】shell如何执行用户的指令
shell有两种执行指令的方式,一种方法是用户事先编写一个sh脚本文件,内含shell脚本,而后使用shell程序执行该脚本,这种方式,我们习惯称为shell编程
第二种形式,则是用户直接在shell界面上执行shell命令,由于shell界面的关系,大家都习惯一行行的书写,很少写出成套的程序来一起执行,所以也称命令行。
总结:shell可以说只是为用户与机器之间搭建成的一个桥梁,让我们能够通过shell来对计算机进行操作和交互,从而达到让计算机为我们服务的目的。
以上。
参考资料:
【shell的定义】http://ke..com/view/849.htm
【shell学习】http://wiki.ubuntu.org.cn/Shell%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80

④ linux下的shell是什么

什么是shell
shell是用户和Linux
操作系统
之间的
接口
。Linux中有多种shell,其中缺省使用的是Bash。本章讲述了shell的工作原理,shell的种类,shell的一般操作及Bash的
特性

什么是shell
Linux系统的shell作为操作系统的
外壳
,为用户提供使用操作系统的接口。它是
命令语言
、命令
解释程序

程序设计语言
的统称。
shell是用户和
Linux内核
之间的接口
程序
,如果把Linux内核想象成一个
球体
的中心,shell就是围绕
内核
的外层。当从shell或其他程序向Linux传递命令时,内核会做出相应的反应。
shell是一个命令语言
解释器
,它拥有自己内建的shell命令集,shell也能被系统中其他
应用程序
所调用。用户在提示符下输入的命令都由shell先解释然后传给Linux核心。
Shell是一种具备
特殊功能
的程序,
它是介于使用者和
UNIX/linux
操作系统之核心
程序(kernel)间的一个接口。为什么我们说
shell
是一种介于系统核心程序与使用者
间的中介者呢?读过操作系统概论的读者们都知道操作系统是一个
系统资源
的管理者与分
配者,当您有需求时,您得向系统提出;从操作系统的角度来看,它也必须防止使用者因
为错误的操作而造成系统的伤害?众所周知,对
计算机
下命令得透过命令(command)

是程序(program);程序有编译器(compiler)将程序转为
二进制代码
,可是命令呢?
其实shell
也是一支程序,它由
输入设备
读取命令,再将其转为计算机可以了解的机械码,
然后执行它。
各种操作系统都有它自己的
shell,以
DOS
为例,它的
shell
就是
command.com文
件。如同
DOS
下有
NDOS,4DOS,DRDOS
等不同的命令解译程序可以取代标准的
command.com
,UNIX
下除了
Bourne
shell(/bin/sh)
外还有
C
shell(/bin/csh)、
Korn
shell(/bin/ksh)、Bourne
again
shell(/bin/bash)、Tenex
C
shell(tcsh)
等其它的
shell。UNIX/linux将
shell
独立于核心程序之外,
使得它就如同一般的应用
程序,
可以在不影响操作系统本身的情况下进行修改、更新版本或是添加新的功能。
有一些命令,比如改变工作目录命令cd,是包含在shell
内部
的。还有一些命令,例如
拷贝
命令cp和移动命令rm,是存在于
文件系统
中某个目录下的单独的程序。对用户而言,不必关心一个命令是建立在shell内部还是一个单独的程序。
shell首先检查命令是否是
内部命令
,若不是再检查是否是一个应用程序(这里的应用程序可以是Linux本身的
实用程序
,如ls和rm,也可以是购买的商业程序,如xv,或者是
自由软件
,如emacs)。然后shell在搜索
路径
里寻找这些应用程序(搜索路径就是一个能找到可执行程序的目录列表)。如果键入的命令不是一个内部命令并且在路径里没有找到这个
可执行文件
,将会显示一条错误信息。如果能够成功找到命令,该内部命令或应用程序将被分解为
系统调用
并传给Linux内核。
shell的另一个重要特性是它自身就是一个解释型的程序设计语言,shell程序设计语言支持绝大多数在
高级语言
中能见到的程序
元素
,如
函数

变量

数组
和程序控制结构。shell
编程语言
简单易学,任何在提示符中能键入的命令都能放到一个可执行的shell程序中。
当普通用户成功登录,系统将执行一个称为shell的程序。正是shell进程提供了命令行提示符。作为默认值(TurboLinux系统默认的shell是BASH),对普通用户用“$”作提示符,对超级用户(root)用“#”作提示符。
一旦出现了shell提示符,就可以键入
命令名称
及命令所需要的
参数
。shell将执行这些命令。如果一条命令花费了很长的时间来运行,或者在屏幕上产生了大量的输出,可以从
键盘
上按ctrl+c发出中断
信号
来中断它(在正常结束之前,中止它的执行)。
当用户准备结束登录对话进程时,可以键入logout命令、exit命令或文件结束符(EOF)(按ctrl+d实现),结束登录。

⑤ 请教会linux shell脚本的=~是什么意思

应该是正则表达式的字符判断

if [[ $i =~ ^[0-9]+$ ]] && echo 1

1、^是匹配字符串开始的意思,[0-9]只要不是数字都不要。

2、~ +的意思的^[0-9]的范围里匹配一次以上+ $是匹配结束符。

touch -t "201109021200.00" tempfile

使用引号内的时间戳在当前目录建立一个叫tempfile的文件

find -name "*VIRTUALID*" -newer tempfile -exec cp {} /home/wbft/luo ;

(5)什么是linuxshell扩展阅读:

实际上Shell是一个命令解释器,它解释由用户输入的命令并且把它们送到内核。不仅如此,Shell有自己的编程语言用于对命令的编辑,它允许用户编写由shell命令组成的程序。

Shell编程语言具有普通编程语言的很多特点,比如它也有循环结构和分支控制结构等,用这种编程语言编写的Shell程序与其他应用程序具有同样的效果。

⑥ linux中的shell是什么有什么作用

Shell是人机交互用的一个程序。
用户有shell了就可以登陆系统并且可以用命令和系统交互,肯定不安全。
没有shell就无法用命令去和系统对话,自然安全多了。
最“土”的办法就是用用户名和密码登陆一下,能进去就是有用户shell,进不去就是没有用户shell。

⑦ 在linux下 什么是bash.什么又是shell

bash 是一个为GNU项目编写的Unix shell,也就是linux用的shell。

Shell俗称壳(用来区别于内核),是指“提供使用者使用界面”的软件,就是一个命令行解释器。

BASH是SHELL的一种,是大多数LINUX发行版默认的SHELL,除BASH SHELL外还有C SHELL等其它类型的SHELL。

(7)什么是linuxshell扩展阅读:

linux主要特性:

1,基本思想:

Linux的基本思想有两点:第一,一切都是文件;第二,每个软件都有确定的用途。其中第一条详细来讲就是系统中的所有都归结为一个文件,包括命令、硬件和软件设备、操作系统、进程等等对于操作系统内核而言,都被视为拥有各自特性或类型的文件。至于说Linux是基于Unix的,很大程度上也是因为这两者的基本思想十分相近。

2,完全免费:

Linux是一款免费的操作系统,用户可以通过网络或其他途径免费获得,并可以任意修改其源代码。这是其他的操作系统所做不到的。正是由于这一点,来自全世界的无数程序员参与了Linux的修改、编写工作,程序员可以根据自己的兴趣和灵感对其进行改变,这让Linux吸收了无数程序员的精华,不断壮大。

3,完全兼容POSIX1.0标准:

这使得可以在Linux下通过相应的模拟器运行常见的DOS、Windows的程序。这为用户从Windows转到Linux奠定了基础。许多用户在考虑使用Linux时,就想到以前在Windows下常见的程序是否能正常运行,这一点就消除了他们的疑虑。

4,多用户、多任务:

Linux支持多用户,各个用户对于自己的文件设备有自己特殊的权利,保证了各用户之间互不影响。多任务则是现在电脑最主要的一个特点,Linux可以使多个程序同时并独立地运行。

5,良好的界面:

Linux同时具有字符界面和图形界面。在字符界面用户可以通过键盘输入相应的指令来进行操作。它同时也提供了类似Windows图形界面的X-Window系统,用户可以使用鼠标对其进行操作。在X-Window环境中就和在Windows中相似,可以说是一个Linux版的Windows。

⑧ linux下的 shell到底是什么啊

在计算机科学中,是指“提供用户使用界面”的软件,通常指的是命令行界面的解析器。一般来说,shell是指操作系统中,提供访问内核所提供之服务的程序。

⑨ Linux Shell是什么

Shell,英文本意是外壳,Linux Shell 就是 Linux 操作系统的外壳,为用户提供使用操作系统的接口,是 Linux 系统用户交互的重要接口。登录 Linux 系统或者打开 Linux 的终端,都将会启动 Linux 所使用的 Shell。

Linux Shell 一个命令解释器,是 Linux 下最重要的交互界面,从标准输入接收用户命令,将命令进行解析并传递给内核,内核则根据命令,作出相应的动作,如果有反馈信息,则输出到标准输出上,示意过程如下图所示。嵌入式 Linux 的标准输入和输出都是串口终端。你可以去看一下M283-ARM9核心板



热点内容
c语言登陆界面 发布:2024-09-28 05:20:09 浏览:890
我的世界小本玩的服务器的地址 发布:2024-09-28 05:19:26 浏览:649
云服务器开传奇私服 发布:2024-09-28 05:19:22 浏览:134
360网盘不能上传 发布:2024-09-28 05:18:51 浏览:754
对于编译原理的学习 发布:2024-09-28 05:05:54 浏览:520
sql强制转换 发布:2024-09-28 04:46:13 浏览:444
phpwithldap 发布:2024-09-28 04:34:44 浏览:592
手机怎么给支付宝加密 发布:2024-09-28 04:20:52 浏览:693
怎么机wifi密码 发布:2024-09-28 04:19:25 浏览:777
win10安装密码怎么设置 发布:2024-09-28 04:18:42 浏览:897