Linux 第五堂04/22

收尋殘留檔 ls -lA .*.swp

kill 預設為SIGTERM(15)

確認開機方式

linux 第一支啟動的程式為init

​​​​which init 

​​​​ls -l /usr/sbin/init

​​​​-> /lib/systemd/systemd

​​​​(有systemd的話就是systemd開機)

systemctl 指令

控制與檢查systemctl服務狀態

​​​​systemctl (顯示所有unit)

​​​​systemctl list-unit-files (以高可讀方式列出
​​​​    enabled 開機自動啟用
​​​​    disabled 開機不自動啟用
​​​​
​​​​用於確定ssh是不是runing
​​​​systemctl status ssh.service (檢查ssh服務)
​​​​systemctl restart ssh.service (重啟ssh服務)

ctrl+z 送到背景暫停 指令

​​​​jobs (列出背景程式)

​​​​bg + 編號 (繼續在背景作業)
​​​​
​​​​fg + 編號 (將背景作業送到前景)
​​​​
​​​​*在ps中只能看有沒有在記憶體

ps -el 查看目前程序資訊+執行狀況

​​​​ps -el | grep '關鍵字'

kill 預設為SIGTERM(15)

收尋殘留檔 ls -lA .*.swp

Ctrl+D

​​​​在bash時是登出
​​​​
​​​​在互動時為完畢(結束)程序

檔案現況

do_sig 處理信號

do_sys 系統模式

ping -c4 Intemet_FQDN

1.網路有通
2.預設路由是正確的
3.名稱解析(DNS)是正確的
4.有合法IP(但不一定是正確的)

查IP要用ip adder show

查帳號、密碼、群組

​​​​# grep 'hadoop' /etc/passwd /etc/shadow /etc/group (查帳號、密碼、群組)
​​​
​​​
​​​​/etc/passwd:hadoop:x:1001:1001:,,,:/home/hadoop:/bin/bash (帳號名稱 編號只有自己有,1000號起跳)

​​​​/etc/shadow:hadoop:$6$MtY4jI97.oERMQ1K$WrpNJoIq8QC/q5Yc4.Zo5UZeF94bgcWLsQfPcUDkU/tIJf7h47WzQlu7HO6cixaUzmffq78M70Nuw9BVFKLSP.:19104:0:99999:7::: (密碼 加密方式$6$ > sha-512)

​​​​/etc/group:hadoop:x:1001: (私有群組,只有自己本人,群組名為帳號名)

變更使用者與群組

修改使用者:

修改群組:

一次改兩個:

簡寫:

bash中開bash

新開的與原來的不一樣(在不同記憶體位置上)

login shell 流程

​​​​/etc/profile
​​​​/etc/profile calls /ect/bash.bashrc
​​​​/etc/profile calls /etc/profile.d/*.sh
​​​​(系統)
​​​​(個人)
​​​​~/.profile
​​​​~/.profile calls ~/.bashrc


錯誤回報

若筆記內有發現錯誤隨時可以登入後在這邊留言~

Select a repo