當前位置:首頁 » 操作系統 » 什麼是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核心板



熱點內容
正則特殊字元需要反編譯嗎 發布:2024-09-28 07:22:56 瀏覽:309
昆特牌外服安卓怎麼登錄 發布:2024-09-28 07:19:17 瀏覽:882
在linux下安裝win7 發布:2024-09-28 07:14:55 瀏覽:390
伺服器170台電腦配置 發布:2024-09-28 07:09:09 瀏覽:776
iis設置ftp 發布:2024-09-28 06:39:18 瀏覽:410
阿里雲伺服器購買價格 發布:2024-09-28 06:38:37 瀏覽:621
緩存平台 發布:2024-09-28 06:38:34 瀏覽:956
分類器python 發布:2024-09-28 06:38:32 瀏覽:269
編譯原理技術與工具 發布:2024-09-28 06:38:32 瀏覽:394
java抽簽 發布:2024-09-28 06:29:27 瀏覽:912