CentOS 7 默认已不再安装此命令,其中很多功能用 ip addr 指令 替代了。
[root@xxx xxx]# ifconfig -bash: ifconfig: command not found
yum安装
yum install net-tools -y
CentOS 7 默认已不再安装此命令,其中很多功能用 ip addr 指令 替代了。
[root@xxx xxx]# ifconfig -bash: ifconfig: command not found
yum安装
yum install net-tools -y
一、sed查看某时间段到现在的系统日志
sed -n '/# Time: 180925/,$p' slow.log > slow-9.25.log
二、sed 截选时间段日志
sed -n '/起始时间/,/结束时间/p' show.log > show-9.25.log
mount: wrong fs type, bad option, bad superblock on sh2.cifang.org:/nfs/vhosts/img/, missing codepage or helper program, or other error (for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program) In some cases useful info is found in syslog - try dmesg | tail or so.
ts: (ts是tabstop的缩写)一个tab显示多少个空格的长度,vim默认8。
autoindent: 前行有缩进时,后续的新行将会自动缩进到相同的位置。
softtabstop: 编辑模式的时候按退格键的时候退回缩进的长度。
shiftwidth: 每一级缩进的长度,一般设置成跟 softtabstop 一样。
expandtab: 缩进用空格来表示。
noexpandtab: 缩进用制表符表示。
find 命令是递归遍历文件夹
基本语法
$ find [path] [option] [expression]
参数
-maxdepth n :指明遍历的深度
find ./ -maxdepth 1 -type d
注:如上n为1时,即遍历当前层级的目录文件。
配置apache支持.htaccess
AllowOverride All
1. 目录/etc/httpd/conf.d下新建vhosts.conf文件,内容如下
Listen 80 <VirtualHost *:80> DocumentRoot "/www" DirectoryIndex index.html index.php <Directory "/www"> Options -Indexes +FollowSymlinks AllowOverride All Require all granted </Directory> </VirtualHost>
找到乱码文件的inode号码
[root@localhost ~]# ll -ih 655786 -rw-r--r-- 1 root root 691002 Jan 1 00:00 ???k?E??.tgz
mv重命名
find . -inum 655786 |xargs -i mv {} newname.tgz
rm删除
find . -inum 655786 -exec rm {} -rf \;
主 5.1.73 从 5.5.58 配置主从同步后,出现某些新建表SQL无法同步。
原因 5.1.73版默认引擎MYISAM 5.5.58默认INNODB。因为主服务器创建表sql定义了引擎,所以在从执行失败。
解决方法,修改从服务器mysql引擎为MYISAM,在my.cnf中加
default-storage-engine=MyISAM
登录mysql后执行命令提示
Ignoring query to other database