/dev/sda1
举例:/dev/sdc6代表第三块SCSI硬盘的第2个逻辑分区
[root@vmcentos7test system]
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
cat /proc/cpuinfo | grep "cpu cores"
mount [-t 文件系统类型] 设备名 挂载点
mount /dev/cdrom /mnt/
umount 挂载目录
umount /mnt/usb
umount /mnt/cdrom
- 将开机执行的命令写入
rc.local
文件中(需要给予此文件可执行权限“x
”)
[root@zabbix ~]
lrwxrwxrwx 1 root root 13 Sep 21 10:12 /etc/rc.local -> rc.d/rc.local
[root@zabbix ~]
-rwx------ 1 root root 722 Oct 13 18:24 /etc/rc.d/rc.local
.bash_history
最大1000条记录
可修改/etc/profile中的HISTSIZE值
!!
!n
HISTTIMEFORMAT="%Y/%m/%d %H:%M:%S "
source /etc/profile
[root@onlytest home]
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键补全命令
[root@onlytest ~]
[root@onlytest ~]
总用量 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 ~]
$ 变量前缀,!$组合,正则里面表示行尾
;多条命令写到一行,用分号分割
~ 用户家目录,后面正则表达式表示匹配符
& 放到命令后面,会把命令丢到后台
> >> 2> 2>> &>
[ ] 指定字符中的一个,[0-9],[a-zA-Z],[abc]
|| 和 && ,用于命令之间