内射老阿姨1区2区3区4区_久久精品人人做人人爽电影蜜月_久久国产精品亚洲77777_99精品又大又爽又粗少妇毛片

在Windows系統(tǒng)和Linux系統(tǒng)中怎么打造一個(gè)好終端

這篇文章主要介紹“在Windows系統(tǒng)和Linux系統(tǒng)中怎么打造一個(gè)好終端”,在日常操作中,相信很多人在在Windows系統(tǒng)和Linux系統(tǒng)中怎么打造一個(gè)好終端問題上存在疑惑,小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對(duì)大家解答”在Windows系統(tǒng)和Linux系統(tǒng)中怎么打造一個(gè)好終端”的疑惑有所幫助!接下來,請(qǐng)跟著小編一起來學(xué)習(xí)吧!

網(wǎng)站的建設(shè)創(chuàng)新互聯(lián)專注網(wǎng)站定制,經(jīng)驗(yàn)豐富,不做模板,主營網(wǎng)站定制開發(fā).小程序定制開發(fā),H5頁面制作!給你煥然一新的設(shè)計(jì)體驗(yàn)!已為混凝土攪拌機(jī)等企業(yè)提供專業(yè)服務(wù)。

術(shù)語

在Windows系統(tǒng)和Linux系統(tǒng)中怎么打造一個(gè)好終端

shell用于執(zhí)行命令。終端(terminal)是運(yùn)行shell的包裝器。在終端上可以設(shè)置字體、字體大小、配色方案以及支持多個(gè)選項(xiàng)卡。終端仿真器的示例包括GNOME終端、KDE的Konsole,Terminator和XTerm。對(duì)于Linux系統(tǒng),筆者建議保留默認(rèn)值。Windows適用Windows  Terminal;Mac適用iTerm2。

在Windows系統(tǒng)和Linux系統(tǒng)中怎么打造一個(gè)好終端

圖源:MartinThoma)

(Linux上的四個(gè)終端仿真器(Gnome  Terminal、Konsole、XTerm、Terminator)。XTerm不直接支持標(biāo)簽。其他的打開了2個(gè)選項(xiàng)卡。它們都運(yùn)行Bash shell。

系統(tǒng)的Shell包括ZSH、Bash、fish。Windows系統(tǒng)典型的shell是PowerShell。可以通過執(zhí)行echo $  0來查看正在運(yùn)行的shell。Linux系統(tǒng)使用更多的是Bash shell。

在Windows系統(tǒng)和Linux系統(tǒng)中怎么打造一個(gè)好終端

 圖源:Martin Thoma

(在Gnome終端中的三個(gè)Linux shell(ZSH、Bash、fish),ZSH shell經(jīng)過了大量更改;Bash shell和fish shell顯示默認(rèn)值??梢?,fish shell具有其他兩個(gè)shell缺少的內(nèi)聯(lián)自動(dòng)提示功能。)

每個(gè)shell都有提示符(prompt)。提示符是光標(biāo)之前寫入的內(nèi)容。它表示可以輸入指令并提供有用的背景信息。在上面的示例中,提示符包含用戶名moose,當(dāng)前計(jì)算機(jī)pc08  ,當(dāng)前工作目錄 ~/GitHub/MartinThoma/flake8-simplify,活躍git分支feature/19以及進(jìn)行了±修改的事實(shí)。

字體

無論選擇哪個(gè),字體都很重要。你可能想要一個(gè)等寬字體,相信我一定要安裝powerline字體。powerline字體能使shell使用像圖像的字符。它可以使提示符效果更好。筆者比較喜歡UbuntuMono和DroidSans  Mono:

在Windows系統(tǒng)和Linux系統(tǒng)中怎么打造一個(gè)好終端

上面一行是Ubuntu Mono,下面是Droid Sans Mono。二者都不錯(cuò),Ubuntu Mono略勝一籌。| 圖源:Martin  Thoma

也有Fira Code、Jetbrains Mono 這樣的“編程字體”。筆者不喜歡它們,因?yàn)楹茈y識(shí)別所寫內(nèi)容。

Windows終端

首先確保已安裝Windows終端。啟動(dòng)終端并找到設(shè)置。它是這個(gè)指下的“小箭頭”:

在Windows系統(tǒng)和Linux系統(tǒng)中怎么打造一個(gè)好終端

點(diǎn)擊“Settings”。| 圖源:MartinThoma

可以選擇JSON文件隨自己喜好而更改。如下:

// This file was initially generated byWindows Terminal 1.2.2381.0           // It should still be usable in newerversions, but newer versions might have additional           // settings, help text, or changes thatyou will not see unless you clear this file           // and let us generate a new one foryou.              // To view thedefault settings, hold "alt" while clicking onthe "Settings" button.           // For documentation on thesesettings, see: https://aka.ms/terminal-documentation           {               "$schema": "https://aka.ms/terminal-profiles-schema",                  "defaultProfile": "{2c4de342-38b7-51cf-b940-2309a097f518}",              "initialCols":  120,              "initialRows":  30,                  //Youcanaddmoreglobalapplicationsettingshere.              //Tolearnmoreaboutglobalsettings,visithttps://aka.ms/terminal-global-settings                  //Ifenabled, selectionsareautomaticallycopiedtoyourclipboard.              "copyOnSelect": false,                  //Ifenabled,formatteddataisalsocopiedtoyourclipboard              "copyFormatting": false,                  //Aprofilespecifiesacommandtoexecutepairedwithinformationabouthowitshouldlookandfeel.              //Eachoneofthemwillappearinthe NewTab dropdown,              //   andcanbeinvokedfromthecommandlinewith`wt.exe-pxxx`              //Tolearnmoreaboutprofiles,visithttps://aka.ms/terminal-profile-settings              "profiles":              {                  "defaults":                  {                       //Putsettingsherethatyouwanttoapplytoallprofiles.                  },                  "list":                  [                       {                           //Makechangesheretothepowershell.exeprofile.                           "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",                           "name": "WindowsPowerShell",                           "commandline": "powershell.exe",                           "hidden": false,                           "fontFace": "DejaVuSans Mono for Powerline"                       },                       {                           //Makechangesheretothecmd.exeprofile.                           "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",                           "name": "CommandPrompt",                           "commandline": "cmd.exe",                           "hidden": false                       },                       {                           "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",                           "hidden": false,                           "name": "Ubuntu",                           "source": "Windows.Terminal.Wsl",                           "fontFace": "DejaVuSans Mono for Powerline",                           "colorScheme":  "Solarized Dark",                       },                       {                           "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",                           "hidden": false,                           "name": "AzureCloud Shell",                           "source": "Windows.Terminal.Azure"                       }                  ]              },                  //Addcustomcolorschemestothisarray.              //Tolearnmoreaboutcolorschemes,visithttps://aka.ms/terminal-color-schemes              "schemes": [                               {                                   "background":  "#073642",                                   "black":  "#073642",                                   "blue":  "#268BD2",                                   "brightBlack":  "#002B36",                                   "brightBlue":  "#839496",                                   "brightCyan":  "#93A1A1",                                   "brightGreen":  "#586E75",                                  "brightPurple":  "#6C71C4",                                   "brightRed":  "#CB4B16",                                   "brightWhite":  "#FDF6E3",                                   "brightYellow":  "#657B83",                                   "cyan":  "#2AA198",                                   "foreground":  "#FDF6E3",                                   "green":  "#859900",                                   "name":  "Solarized Dark",                                   "purple":  "#D33682",                                   "red":  "#D30102",                                   "white":  "#EEE8D5",                                   "yellow":  "#B58900"                               },                               {                                   "background":  "#FDF6E3",                                   "black":  "#073642",                                   "blue":  "#268BD2",                                   "brightBlack":  "#002B36",                                   "brightBlue":  "#839496",                                   "brightCyan":  "#93A1A1",                                   "brightGreen":  "#586E75",                                   "brightPurple":  "#6C71C4",                                   "brightRed":  "#CB4B16",                                   "brightWhite":  "#FDF6E3",                                   "brightYellow":  "#657B83",                                   "cyan":  "#2AA198",                                   "foreground":  "#073642",                                   "green":  "#859900",                                   "name":  "Solarized Light",                                   "purple":  "#D33682",                                   "red":  "#D30102",                                   "white":  "#EEE8D5",                                   "yellow":  "#B58900"                               },              ],                  //Addcustomkeybindingstothisarray.              //Tounbindakeycombinationfromyourdefaults.json,setthecommandto"unbound".              //Tolearnmoreaboutkeybindings,visithttps://aka.ms/terminal-keybindings              "keybindings":              [                  //CopyandpasteareboundtoCtrl+Shift+CandCtrl+Shift+Vinyourdefaults.json.                  //ThesetwolinesadditionallybindthemtoCtrl+CandCtrl+V.                  //Tolearnmoreaboutselection, visithttps://aka.ms/terminal-selection                  { "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" },                  { "command": "paste", "keys": "ctrl+v" },                                    //PressCtrl+Shift+Ftoopenthesearchbox                  { "command": "find", "keys": "ctrl+shift+f" },                                    //PressAlt+Shift+Dtoopenanewpane.                  //-"split":"auto"makesthispaneopeninthedirectionthatprovidesthemostsurfacearea.                  //-"splitMode":"duplicate"makesthenewpaneusethefocusedpane sprofile.                  //Tolearnmoreaboutpanes, visithttps://aka.ms/terminal-panes                  { "command": { "action": "splitPane", "split": "auto", "splitMode": "duplicate" },                     "keys": "alt+shift+d" },                  {"command": "closeTab", "keys": "ctrl+w"},                  {"command": "newTab", "keys": "ctrl+t"}              ]           }

下載并安裝所有4種“ DejaVu Sans Mono  Powerline”字體。在已知的所有系統(tǒng)上,字體安裝都是一個(gè)流程:雙擊字體,然后跳出一個(gè)有“安裝”按鈕的窗口。

Linux和Windows終端:Aminal

Aminal是用Go語言編寫的終端仿真器??捎糜贚inux、Windows和Mac。它允許通過配置文件完成顏色、鍵盤快捷鍵等配置。首先需要在系統(tǒng)中安裝并配置Go語言。Ubuntu的示例如下:

$ sudo apt-get install golang libgl1-mesa-dev xorg-dev $ export GOPATH="$HOME/go" $ export GOBIN=$(go env GOPATH)/bin

接著就可以安裝并運(yùn)行aminal了:

$ go get -u github.com/liamg/aminal $ aminal

Linux系統(tǒng):Gnome終端

可以通過編輯文件來自定義Gnome終端。這里筆者用12號(hào)字設(shè)置了Ubuntu Mono衍生的powerline常規(guī)字體。

在Windows系統(tǒng)和Linux系統(tǒng)中怎么打造一個(gè)好終端

圖源:Martin Thoma

命令是為了zsh而設(shè)置,因?yàn)檫@是筆者最喜歡的shell。

在Windows系統(tǒng)和Linux系統(tǒng)中怎么打造一個(gè)好終端

圖源:Martin Thoma

顏色設(shè)置為solarized dark(從左到右、從上到下)

  • 背景: #2e3436 / #555753

  • 深紅: #cc0000 / 淺紅: ef2929

  • 深綠: #4e9a06 / 淺綠: #8ae234

  • 深黃: #c4a000 / 淺黃: #fce94f

  • 深藍(lán): #3465a4 / 淺藍(lán): #729fcf

  • 深紫: #75507b / 淺紫: #ad7fa8

  • 深藍(lán)綠: #06989a / 淺藍(lán)綠: #34e2e2

  • 深灰: #d3d7cf /淺灰: #eeeeec

在Windows系統(tǒng)和Linux系統(tǒng)中怎么打造一個(gè)好終端

Linux系統(tǒng):fish shell

安裝fish shell:

sudo apt-get install fish

更改終端仿真器的默認(rèn)shell為fish。在Gnome終端叫做“自定義命令”

接著安裝“Oh My Fish”:

curl -L https://get.oh-my.fish | fish

然后將主題設(shè)置為agnoster:

omf install agnoster omf theme agnoster

別名

要使終端表現(xiàn)出色,核心部分的命令就要簡(jiǎn)短。因此為命令創(chuàng)建一個(gè)別名,即簡(jiǎn)短版的原命令。最常見是將目錄更改為上一級(jí)。假如是在  /home/user/foo/bar中,則要轉(zhuǎn)到 /home/user/foo。大多數(shù)shell都必須輸入cd .. 。我喜歡將其縮寫為  ..。所以別名就是alias ..='cd ..' 。

語法可能不同,具體取決于shell。對(duì)于Bash、ZSH和fish:

alias short= long

在bash中要插入到 ~/.bashrc,ZSH中則是 ~/.zshrc,fish中也不相同。一些別名如下:

# Shorten things alias ..= cd ..  alias ...= cd ../../  alias ll= ls -alF  alias la= ls -A  alias l= ls -CF  alias c= clear # If your terminal supports colors, use them! alias lsls= ls --color=auto  alias grepgrep= grep --color=auto  alias fgrepfgrep= fgrep --color=auto  alias egrepegrep= egrep --color=auto  alias diff= colordiff # Works only if you have notify-send alias alert= notify-send --urgency=low -i "$([ $? = 0 ] && echoterminal || echo error)" "$(history|tail -n1|sed -e   s/^s*[0-9]+s*//;s/[;&|]s*alert$//   )"

到此,關(guān)于“在Windows系統(tǒng)和Linux系統(tǒng)中怎么打造一個(gè)好終端”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)砀鄬?shí)用的文章!

網(wǎng)站欄目:在Windows系統(tǒng)和Linux系統(tǒng)中怎么打造一個(gè)好終端
網(wǎng)頁鏈接:http://www.rwnh.cn/article8/ghcsip.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)建站全網(wǎng)營銷推廣、做網(wǎng)站、面包屑導(dǎo)航ChatGPT、移動(dòng)網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

小程序開發(fā)
咸丰县| 观塘区| 黑山县| 卓资县| 黄冈市| 资阳市| 和静县| 浏阳市| 昌平区| 海丰县| 六安市| 长海县| 武夷山市| 安乡县| 嘉荫县| 义马市| 通辽市| 张家川| 长治市| 确山县| 玉山县| 洛阳市| 西乡县| 米泉市| 富顺县| 横山县| 彰化市| 河西区| 元谋县| 兴业县| 呼玛县| 孟村| 新田县| 福州市| 鹤山市| 泽库县| 桐梓县| 丹巴县| 郎溪县| 乡宁县| 扶余县|