linux補充資料

2021-08-30 06:22:55 字數 2847 閱讀 8977

/dev/sda1	

#/dev是所有裝置檔案存放的目錄,sd代表scsi硬碟,如果是hd則代表是ide硬碟;

#a代表第一塊硬碟;

#1代表分割槽,前4個分割槽(主分割槽或者擴充套件分割槽)用數字1~4表示,邏輯分割槽從5開始。

舉例:/dev/sdc6代表第三塊scsi硬碟的第2個邏輯分割槽

[root@vmcentos7test system]

# lsblk

name maj:min rm size ro type mountpoint

sda 8:0 0 60g 0 disk

├─sda1 8:1 0 4g 0 part /boot

├─sda2 8:2 0 4g 0 part [swap]

└─sda3 8:3 0 52g 0 part /

sr0 11:0 1 1024m 0 rom

cat /proc/cpuinfo |

grep

"physical id"

|sort

|uniq

|wc -l #檢視物理cpu個數

cat /proc/cpuinfo |

grep

"cpu cores"

#檢視每個物理cpu中核心的個數

mount

[-t 檔案系統型別] 裝置名 掛載點

mount /dev/cdrom /mnt/

umount 掛載目錄 #解除安裝裝置

umount /mnt/usb #解除安裝u盤

umount /mnt/cdrom #解除安裝光碟

[root@zabbix ~]

# ll /etc/rc.local

lrwxrwxrwx 1 root root 13 sep 21 10:12 /etc/rc.local -> rc.d/rc.local

#可以看出/etc/rc.local是/etc/rc.d/rc.loacl的軟鏈結

[root@zabbix ~]

# ll /etc/rc.d/rc.local

-rwx------ 1 root root 722 oct 13 18:24 /etc/rc.d/rc.local

.bash_history	#當前使用者

最大1000條記錄

可修改/etc/profile中的histsize值 #所有使用者!!

#執行上一條命令,即history中的最後一條

!n #執行history中的第n條命令

histtimeformat=

"%y/%m/%d %h:%m:%s "

#在/etc/profile中新增此命令,使得history帶有時間顯示

source /etc/profile

#新增後如下

[root@onlytest home]

# grep hist /etc/profile

histsize=1000

histtimeformat=

"%y/%m/%d %h:%m:%s "if[

"$histcontrol"

="ignorespace"];

then

export histcontrol=ignoreboth

export histcontrol=ignoredups

export path user logname mail hostname histsize histcontrol

[root@onlytest home]

#

按tab鍵補全命令

#引數補全,安裝bash-completion

[root@onlytest ~]

# touch .txt

[root@onlytest ~]

# ll

總用量 8

-rw-r--r--. 1 root root 0 12月 11 14:34 1.txt

-rw-r--r--. 1 root root 0 12月 11 14:34 2.txt

-rw-r--r--. 1 root root 0 12月 11 14:34 3.txt

-rw-r--r--. 1 root root 0 12月 11 14:34 4.txt

-rw-r--r--. 1 root root 0 12月 11 14:34 5.txt

-rw-r--r--. 1 root root 0 12月 11 14:34 6.txt

-rw-r--r--. 1 root root 0 12月 11 14:34 7.txt

-rw-r--r--. 1 root root 0 12月 11 14:34 8.txt

-rw-r--r--. 1 root root 0 12月 11 14:34 9.txt

#同理,建立多個資料夾

[root@onlytest ~]

# mkdir

$ 變數字首,!$組合,正則裡面表示行尾

;多條命令寫到一行,用分號分割

~ 使用者家目錄,後面正規表示式表示匹配符

& 放到命令後面,會把命令丟到後台

>

>> 2> 2>>

&>

指定字元中的乙個,[0-9],[a-za-z],[abc]

|| 和 && ,用於命令之間

HTML標頭檔案補充資料

一 元資訊標誌 1 http equiv屬性 1 定義字符集 2 自動重新整理 240秒 3 設定跳轉 url 自動跳轉時間3秒 4 設定禁用快取 5 設定有效期 2010.12.31.星期五10點11 分20秒 6 設定轉場效果 duration value設定過度時間 transition nu...

HTML中Css補充資料

3種樣式表 內部樣式表 在中定義不同的選擇器 外部樣式表運用 新建拓展名為css的樣式表檔案 在css樣式表檔案中,可編寫不同的選擇器 在網頁中,使用標記連線外部的樣式表檔案 在對應的html標記中,使用id id 選擇器名 class class 選擇器名 行內樣式表 不建議使用行內樣式表 在對應...

程序同步3 補充 資料的加鎖操作

1.模擬搶票 防止出現多人搶同一張票 usr bin env python coding utf 8 author xp blog url from multiprocessing import process,lock import time import random import json 模...