RPM常用命令
-ivh 安裝顯示安裝進(jìn)度
-Uvh 省級(jí)軟件包
-qpl 列出RPM軟件包內(nèi)的文件信息
-qpi 列出RPM軟件包的描述信息
-qf 查找指定文件屬于哪個(gè)RPM軟件包
-Va 校驗(yàn)所有的RPM軟件包鲁僚,查找丟失的文件
-e 刪除包
rpm -q filename #查詢程序是否安裝
rpm -qa|grep filename # 搜索指定rpm包是否安裝
rmp -ql filename #搜索列出rpm包
掛載命令
- 掛載:
mount --bind 源文件夾 目標(biāo)文件夾
- 移除掛載:
umount 源文件夾
- 移除整個(gè)文件夾下的所有掛載:
umount -a 文件夾
解壓/壓縮命令
解壓tar :
tar -xvf xxx.tar
壓縮tar:
tar -cvf xxx.tar
linux下建立文件夾讓window來(lái)訪問(wèn)
linux 下建立文件夾:/mnt/remote
chmod –R 0777 remote文件夾
vim /etc/samba/smb.conf 修改下面值并保存:
security=share
[share]
path=/mnt/share
重啟smb服務(wù):
service smb restart
或
/etc/init.d/samba start
smb.conf配置文件的內(nèi)容為:
[global]
workgroup = Storage
create mask = 0755
directory mask = 0755
server string = Samba Server
security = share
#admin users = admin
#load printers = yes
log file = /var/log/log.%m
max log size = 8
socket options = IPTOS_LOWDELAY TCP_NODELAY SO_RCVBUF=131072 SO_SNDBUF=262144
max xmit = 131072
dns proxy = no
read raw = yes
write raw = yes
strict sync = no
sync always = yes
strict locking = no
strict allocate = yes
encrypt passwords = yes
large readwrite = yes
#smb passwd file = /etc/samba/private/smbpasswd
guest account = nobody
delete veto files = True
display charset = UTF
[share]
path = /mnt/share
browseable = yes
writable = yes
available = yes
public = yes
linux下抓包
tcpdump -i any -s 0 -w name.pcap
抓指定IP或端口的包
tcpdump -i any -s 0 host 192.168.1.1 and src port 80 -w name.pcap
linux安裝mysql5.6報(bào)錯(cuò)如下
Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/datafs/data/mysql/localhost.localdomain.pid).
原因是:沒(méi)有mysql數(shù)據(jù)庫(kù)
解決辦法是:(可以先查詢/var/log/mysql.log的日志查看)
[root@localhost ~]# mysql_install_db --user=mysql --datadir=/usr/local/datafs/data/mysql
可以在datadir路徑下生成mysql數(shù)據(jù)庫(kù)呀打,或者用mysql_upgrade命令也可
注意:可能mysql文件的權(quán)限不足可以輸:chown -R mysql:mysql mysql賦予文件訪問(wèn)權(quán)限
linux臨時(shí)修改IP
ifconfig eth1 172.16.1.244 netmask 255.255.255.0
route add default gw 172.16.1.1
linux查詢文件名
whereis 文件名
find / -name 文件名
查詢文件夾里文件個(gè)數(shù)
ls -l|grep "^-"|wc -l //文件個(gè)數(shù)
ls -l|grep "^d"|wc -l //文件夾個(gè)數(shù)
ls -lR|grep "^-"|wc -l //文件個(gè)數(shù)(包含子文件個(gè)數(shù))
grep ^- 表示只保留文件
grep ^d 表示只保留文件夾
./configure不能執(zhí)行問(wèn)題
[root@VOIP poco-1.4.6p1-all]# ./configure
-bash: ./configure: binsh^M: bad interpreter: No such file or directory
原因是configure是dos文件绳泉,需要轉(zhuǎn)成unix格式
vi configure
:set ff=unix
:wq
./configure不能執(zhí)行問(wèn)題2
[root@VOIP poco-1.4.6p1-all]# ./configure
-bash: ./configure: binsh: bad interpreter: No such file or directory
原因是腳本所在的硬盤格式不支持,放到/home/下面執(zhí)行即可
查看有幾張網(wǎng)卡
lspci |grep -i Eth
或者
ip link