linux shell命令之字串的刪除

2022-07-18 19:00:23 字數 420 閱讀 2332

刪除字串的命令如下:

$ #刪除string開頭處與substring匹配的最短子串

$ #刪除string開頭處與substring匹配的最長子串

echo $another_string

20091114 reading hadoop

echo $

114 reading hadoop

echo $

4 reading hadoop

刪除字串還有從結尾開始刪除的,命令如下:

$ #刪除string結尾處與substring匹配的最短子串

$ #刪除string結尾處與substring匹配的最長子串

echo $

20091114 reading h

echo $

20091114 re

Linux shell之列印命令

1 echo 命令 echo是shell的乙個內部指令,用於在螢幕上列印出指定的字串。命令格式 echo arg 您可以使用echo實現更複雜的輸出格式控制。顯示轉義字元 echo it is a test 結果將是 it is a test 雙引號也可以省略。顯示變數 name ok echo n...

Linux shell篇之ps命令

ps process state sysv風格 需要加橫槓 bsd風格 不需要加橫槓 a 所有與終端有關的程序 u x 所有與終端無關的程序 例子 ps aux head 程序狀態 d 不可中斷的睡眠 r 執行或就緒 s 可中斷的睡眠 t 停止 z 僵死 高優先順序程序 n 低優先順序程序 前台程序...

Linux shell 之Shell命令高階

寫在前面 案例 常用 歸類 解釋說明。by jim 監控程式 a.程序檢視 ps ef e表示系統上執行的所有程序,f用於擴充套件輸出一些有用的資訊列。ps efh h引數可以將程序組織為分層格式,可以顯示哪些流程是隨其他程序一起啟動的。ps help ps指令的幫助資訊 b.實時監控 top q退...