部分工具與基礎

2022-02-23 08:09:46 字數 1124 閱讀 5603

shell hello

file pro toos

toos and sed

rpm and yum

行首:#!/bin/shells

注釋:"#" 開頭

執行:bash script 、chmod +x script ; 路徑 / script

建議:新增指令碼的作用,使用方法,引數、變數說明。

type :string number

命名 :- 關鍵字、-數字字母下劃線、駝峰命名

種類 :

test 判斷

[ 判斷 ]

[[ 判斷 ]]

### 登入方式與配置檔案讀取

1.生效範圍

- 全域性:

/etc/profile

/etc/profile.d/*.sh

/etc/bashrc

- 使用者:

~/.bash_profile

~/.bashrc

2.登入形式

- 互動式

1 終端輸入賬號密碼登入

「su - username」 切換的使用者

執行順序:/etc/profile --> /etc/profile.d/*.sh --> ~/.bash_profile -->

~/.bashrc --> /etc/bashrc

- 非互動式

- profile

profile類:

為互動式登入的shell提供配置

全域性:/etc/profile, /etc/profile.d/*.sh

個人:~/.bash_profile

功用:(1) 用於定義環境變數

(2) 執行命令或指令碼

- bashrc

為非互動式和互動式登入的shell提供配置

全域性:/etc/bashrc

個人:~/.bashrc

功用:(1) 定義命令別名和函式

(2) 定義本地變數

- 更改配置檔案後生效方法:

1重啟shell程序

2source 或 . 配置檔名

例 生效全域性bashrc: source /bin/bashrc 或 .空格~.bashrc

- 退出後執行

Centos部分工具命令

啟動 systemctl start httpd 停止 systemctl stop httpd 重啟 systemctl restart httpd 啟動 systemctl start mysqld 停止 systemctl stop mysqld 重啟 systemctl restart my...

linux部分工具命令

一 vim編輯器 1 vim有三種模式 命令模式 vim剛開啟就是命令模式 x刪除乙個字元 nx刪除n個字元 dd刪除 剪下 一行 ndd刪除 剪下 n行 p貼上 nyy複製n行 shift g跳到最後一行 gg回到最後一行 查詢游標所在字串,n查詢下乙個 u撤銷操作 shift zz儲存退出。插入...

Linux中部分工具學習

vim使用須知 在vim底行模式下,set nu設定 顯示 行號 powoff 關機 sync 把資料同步到硬碟裡面 在一般模式下 u 撤銷 一步 u 撤銷 所有操作 yy 複製 nyy 複製n行 dd 刪除當前行 ndd 刪除n行 p 貼上 x 刪除當前字元 ng 跳到行號為n的一行 g 跳到檔案...