日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

CentOS 命令大全 (转)

發(fā)布時間:2023/12/13 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CentOS 命令大全 (转) 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

1、查看系統(tǒng)使用端口并釋放端口

[root@my_nn_01 WEB-INF]# lsof -w -n -i tcp:80

COMMAND???PID USER???FD???TYPE DEVICE SIZE NODE NAME

java????24065 root???34u??IPv6 269149???????TCP *:http (LISTEN)

[root@my_nn_01 WEB-INF]# kill -9 24065

?

2、以KB/MB形式顯示文件列表

[root@cncloud iso]# ls -lh

總計?5.8G

-rw-r--r-- 1 root root 4.1G 2011-08-01 CentOS-5.5-x86_64-bin-DVD-1of2.iso

-rw-r--r-- 1 root root 413M 2011-08-01 CentOS-5.5-x86_64-bin-DVD-2of2.iso

-rw-r--r-- 1 root root 630M 2009-12-07 Win2003.iso

-rw-r--r-- 1 root root 618M 2010-09-08 Windows.Server.2003.R2.With.Sp2 X64.iso

?

3、查看CPU位數(shù)(32 or 64)

[root@cloud_test download]# getconf LONG_BIT

64

?

4、查看當(dāng)前l(fā)inux的版本

[root@cncloud ~]# cat /etc/redhat-release

CentOS release 5.4 (Final)

?

5、uname用于查看系統(tǒng)信息

[root@cncloud ~]# uname -r???#打印發(fā)布的內(nèi)核

2.6.18-164.el5xen

?

# uname -a???????????????#?查看內(nèi)核/操作系統(tǒng)/CPU信息

[root@cloud_test download]# uname -a

Linux cloud_test 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:14 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

?

6、查看系統(tǒng)默認(rèn)語言

echo $LANG $LANGUAGE

cat /etc/sysconfig/i18n

?

7、查看所屬時區(qū)和是否使用UTC時間

[root@cncloud ~]# cat /etc/sysconfig/clock

# The ZONE parameter is only evaluated by system-config-date.

# The timezone of the system is defined by the contents of /etc/localtime.

ZONE="Asia/Shanghai"

UTC=false

ARC=false

?

8、查看主機(jī)名

hostname

cat /etc/sysconfig/network

修改主機(jī)名就是修改這個文件,同時最好也把/etc/hosts文件也修改

?

9、查看開機(jī)運行時間

[root@cncloud ~]# uptime

?13:56:21 up 97 days,??2:51,??2 users,??load average: 0.08, 0.08, 0.05

?

10、查看操作系統(tǒng)版本

[root@cloud_test download]# head -n 1 /etc/issue

CentOS release 5.5 (Final)

?

# cat /proc/cpuinfo????????????#?查看CPU信息

# hostname??????????????#?查看計算機(jī)名

# lspci -tv????????????????????#?列出所有PCI設(shè)備

# lsusb -tv??????????????????#?列出所有USB設(shè)備

[root@cloud_test download]# lsusb -tv

Bus#??1

`-Dev#???1 Vendor 0x0000 Product 0x0000

`-Dev#???2 Vendor 0x0627 Product 0x0001

?

# lsmod???????????????????#?列出加載的內(nèi)核模塊

?

# env?????????????????????#?查看環(huán)境變量資源

?

11、cpu常用查看命令

more /proc/cpuinfo | grep "model name"??

grep "model name" /proc/cpuinfo??

[root@localhost /]# grep "CPU" /proc/cpuinfo??

model name??????: Intel(R) Pentium(R) Dual CPU E2180 @ 2.00GHz??

model name??????: Intel(R) Pentium(R) Dual CPU E2180 @ 2.00GHz??

如果只想顯示第二列內(nèi)容:

grep "model name" /proc/cpuinfo | cut -f2 -d:

?

12、常用內(nèi)存查看命令

grep MemTotal /proc/meminfo

grep MemTotal /proc/meminfo | cut -f2 -d:

free -m | grep "Mem" | awk '{print $2}'

awk '/MemTotal/ {printf( "%.2f\n", $2 / 1024 )}' /proc/meminfo

?

13、查看磁盤總大小:

[root@localhost ~]# fdisk -l |grep Disk | cut -f2 -d:

?498.9 GB, 498999492608 bytes

?1995.9 GB, 1995997970432 bytes

?

我們通過free命令查看機(jī)器空閑內(nèi)存時,會發(fā)現(xiàn)free的值很小。這主要是因為,在linux中有這么一種思想,內(nèi)存不用白不用,因此它盡可能的cache和buffer一些數(shù)據(jù),以方便下次使用。但實際上這些內(nèi)存也是可以立刻拿來使用的。

?

所以?空閑內(nèi)存=free+buffers+cached=total-used

?

14、查看系統(tǒng)安裝的時候裝的軟件包

cat -n /root/install.log

more /root/install.log | wc -l

查看現(xiàn)在已經(jīng)安裝了那些軟件包

rpm -qa

rpm -qa | wc -l

yum list installed | wc -l

不過很奇怪,我通過rpm,和yum這兩種方式查詢的安裝軟件包,數(shù)量并不一樣。沒有找到原因。

?

15、查看鍵盤布局

cat /etc/sysconfig/keyboard

cat /etc/sysconfig/keyboard | grep KEYTABLE | cut -f2 -d=

?

?

16、查看selinux情況

sestatus

sestatus | cut -f2 -d:

cat /etc/sysconfig/selinux

?

關(guān)閉selinux

?

1.[root@linux ~]# vi /etc/selinux/config
# 將底下的設(shè)定值改成這樣:
SELINUX=disabled

2. 修改開機(jī)時 grub 的設(shè)定檔
[root@linux ~]# vi /boot/grub/menu.lst
.....省略.....
??? kernel /boot/vmlinuz-2.6.9 ro root=/dev/hda1 rhgb selinux=0
.....省略.....

3. 重新開機(jī)
[root@linux ~]# sync; reboot

?

17、資源

# free -m????????????????#?查看內(nèi)存使用量和交換區(qū)使用量

[root@cloud_test download]# free -m

?????????????total???????used???????free?????shared????buffers?????cached

Mem:????????2453???????2402?????????50????????0???????272????????799

-/+ buffers/cache:??????????1330???????1123

Swap:????????4094??????????0???????4094

?

# df -h??????????????????#?查看各分區(qū)使用情況

[root@cloud_test download]# df -h

Filesystem????????????Size??Used Avail Use% Mounted on

/dev/hda2??????????????55G???11G???41G??21% /

/dev/hda1??????????????99M???12M???82M??13% /boot

tmpfs?????????????????1.2G?????0??1.2G???0% /dev/shm

?

# du -sh <目錄名>????????#?查看指定目錄的大小

[root@cloud_test download]# du -sh

2.7G

?

[root@cncloud ~]# du /etc -sh

126M????/etc

?

# grep MemTotal /proc/meminfo???#?查看內(nèi)存總量

[root@cloud_test download]# grep MemTotal /proc/meminfo

MemTotal:??????2512164 kB

?

# grep MemFree /proc/meminfo????#?查看空閑內(nèi)存量

# uptime?????????????????#?查看系統(tǒng)運行時間、用戶數(shù)、負(fù)載

?

[root@cloud_test download]# uptime

?20:25:06 up 9 days,??3:52,??3 users,??load average: 0.00, 0.00, 0.00

?

# cat /proc/loadavg??????#?查看系統(tǒng)負(fù)載磁盤和分區(qū)

[root@cloud_test download]# cat /proc/loadavg

0.00 0.00 0.00 1/195 19443

?

[root@aca80a67 ~]# cat /proc/meminfo

?

MemTotal:內(nèi)存總量

MemFree:空閑內(nèi)存大小

Buffers:用于臨時磁盤緩存

Cached:I/O讀寫緩存,不包括SwapCached

SwapCached:曾被換出,但被換回而仍留在swapfile的內(nèi)存大小

其實,MemFree并不能代表系統(tǒng)內(nèi)存空閑總量,系統(tǒng)用于I/O的緩存也應(yīng)該納入空閑內(nèi)存的范圍。內(nèi)存空閑量:

MemFree+Buffers+Cached+SwapCached

[root@aca80a67 ~]# ll -h /proc/kcore

空閑內(nèi)存=free+buffers+cached=total-used

[root@aca80a67 ~]# grep MemTotal /proc/meminfo

MemTotal:??????2058016 kB

?

18、磁盤和分區(qū)

# mount | column -t??????#?查看掛接的分區(qū)狀態(tài)

[root@cloud_test download]# cat /proc/loadavg

0.10 0.03 0.01 1/195 19445

[root@cloud_test download]# mount | column -t

/dev/hda2??on??/?????????????????????????type??ext3?????????(rw)

proc???????on??/proc?????????????????????type??proc?????????(rw)

sysfs??????on??/sys??????????????????????type??sysfs????????(rw)

devpts?????on??/dev/pts??????????????????type??devpts???????(rw,gid=5,mode=620)

/dev/hda1??on??/boot?????????????????????type??ext3?????????(rw)

tmpfs??????on??/dev/shm??????????????????type??tmpfs????????(rw)

none???????on??/proc/sys/fs/binfmt_misc??type??binfmt_misc??(rw)

sunrpc?????on??/var/lib/nfs/rpc_pipefs???type??rpc_pipefs???(rw)

?

# fdisk -l???????????????#?查看所有分區(qū)

[root@cloud_test download]# fdisk -l

?

Disk /dev/hda: 64.4 GB, 64424509440 bytes

255 heads, 63 sectors/track, 7832 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

?

???Device Boot??????Start?????????End??????Blocks???Id??System

/dev/hda1???*???????????1??????????13??????104391???83??Linux

/dev/hda2??????????????14????????7309????58605120???83??Linux

/dev/hda3????????????7310????????7831?????4192965???82??Linux swap / Solaris

?

# swapon -s??????????????#?查看所有交換分區(qū)

[root@localhost ~]# swapon -s

Filename????????????????????????????????Type????????????Size????Used????Priority

/dev/sda3???????????????????????????????partition???????2096472??0???????-1

# hdparm -i /dev/hda?????#?查看磁盤參數(shù)(僅適用于IDE設(shè)備)

[root@localhost ~]# hdparm -i /dev/hdc

?

/dev/hdc:

?

?Model=VMware Virtual IDE CDROM Drive, FwRev=00000001, SerialNo=10000000000000000001

?Config={ SoftSect Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }

?RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0

?BuffType=unknown, BuffSize=32kB, MaxMultSect=0

?(maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0

?IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}

?PIO modes:??pio0 pio1 pio2 pio3 pio4

?DMA modes:??sdma0 sdma1 sdma2 mdma0 mdma1 mdma2

?UDMA modes: udma0 udma1 *udma2

?AdvancedPM=no

?Drive conforms to: ATA/ATAPI-4 T13 1153D revision 17:??ATA/ATAPI-1 ATA/ATAPI-2 ATA/ATAPI-3 ATA/ATAPI-4

?

?* signifies the current active mode

# dmesg | grep IDE???????#?查看啟動時IDE設(shè)備檢測狀況網(wǎng)絡(luò)

[root@localhost ~]# dmesg | grep IDE

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2

PIIX4: IDE controller at PCI slot 0000:00:07.1

Probing IDE interface ide0...

Probing IDE interface ide1...

hdc: VMware Virtual IDE CDROM Drive, ATAPI CD/DVD-ROM drive

Probing IDE interface ide0...

?target0:0:0: FAST-40 WIDE SCSI 80.0 MB/s ST (25 ns, offset 127)

?

19、網(wǎng)絡(luò)

# ifconfig???????????????#?查看所有網(wǎng)絡(luò)接口的屬性

# iptables -L????????????#?查看防火墻設(shè)置

?

關(guān)閉防火墻

#service iptables stop(臨時關(guān)閉。下次重啟系統(tǒng)就不管用了)

#chkconfig iptables off.(永久管用)

或者在system-config-firewall中把iptables的enabled選項取消

?

# route -n???????????????#?查看路由表

[root@localhost ~]# route -n

Kernel IP routing table

Destination?????Gateway?????????Genmask?????????Flags Metric Ref????Use Iface

192.168.171.0???0.0.0.0?????????255.255.255.0???U?????0??????0????????0 eth0

169.254.0.0?????0.0.0.0?????????255.255.0.0?????U?????0??????0????????0 eth0

0.0.0.0?????????192.168.171.2???0.0.0.0?????????UG????0??????0????????0 eth0

# netstat -lntp??????????#?查看所有監(jiān)聽端口

[root@localhost ~]# netstat -lntp

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address???????????????Foreign Address?????????????State???????PID/Program name??

tcp????????0??????0 0.0.0.0:111?????????????????0.0.0.0:*???????????????????LISTEN??????3517/portmap???????

tcp????????0??????0 127.0.0.1:631???????????????0.0.0.0:*???????????????????LISTEN??????3038/cupsd?????????

tcp????????0??????0 127.0.0.1:25????????????????0.0.0.0:*???????????????????LISTEN??????3791/sendmail: acce

tcp????????0??????0 0.0.0.0:763?????????????????0.0.0.0:*???????????????????LISTEN??????3549/rpc.statd?????

tcp????????0??????0 :::22???????????????????????:::*????????????????????????LISTEN??????3769/sshd??????????

# netstat -antp??????????#?查看所有已經(jīng)建立的連接

[root@localhost ~]# netstat -antp

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address???????????????Foreign Address?????????????State???????PID/Program name??

tcp????????0??????0 0.0.0.0:111?????????????????0.0.0.0:*???????????????????LISTEN??????3517/portmap???????

tcp????????0??????0 127.0.0.1:631???????????????0.0.0.0:*???????????????????LISTEN??????3038/cupsd?????????

tcp????????0??????0 127.0.0.1:25????????????????0.0.0.0:*???????????????????LISTEN??????3791/sendmail: acce

tcp????????0??????0 0.0.0.0:763?????????????????0.0.0.0:*???????????????????LISTEN??????3549/rpc.statd?????

tcp????????0??????0 :::22???????????????????????:::*????????????????????????LISTEN??????3769/sshd?????

# netstat -s?????????????#?查看網(wǎng)絡(luò)統(tǒng)計信息進(jìn)程

?

ifconfig eth0 172.10.15.12

注意:使用ifconfig配置的ip地址在linux系統(tǒng)重新啟動后就失效了

如果要想讓地址永遠(yuǎn)生效,可以使用命令

system-config-network命令

?

可以為網(wǎng)卡設(shè)置第二個ip:ifconfig eth0:1 172.10.15.13

后面也可以加上netmask添加子網(wǎng)掩碼

?

[root@cncloud ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR

IPADDR=172.10.15.3

[root@cncloud ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR | cut -f2 -d=

172.10.15.3

[root@cncloud ~]# ifconfig eth0 |grep "inet addr:" |awk '{print $2}'|cut -c 6-

172.10.15.3

[root@cncloud ~]# ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'

172.10.15.3

192.168.122.1

?

20、查看網(wǎng)關(guān)

[root@cncloud ~]# cat /etc/sysconfig/network

NETWORKING=yes

NETWORKING_IPV6=no

HOSTNAME=cncloud.com.cn

GATEWAY=172.10.15.254

?

21、查看dns

[root@cncloud ~]# cat /etc/resolv.conf

nameserver 172.10.15.3

nameserver 202.96.128.86

?

22、進(jìn)程

# ps -ef?????????????????#?查看所有進(jìn)程

# top????????????????????#?實時顯示進(jìn)程狀態(tài)用戶

?

23、用戶

# w??????????????????????#?查看活動用戶

# id <用戶名>????????????#?查看指定用戶信息

[root@localhost ~]# id root

uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) context=root:system_r:unconfined_t:SystemLow-SystemHigh

# last???????????????????#?查看用戶登錄日志

[root@localhost ~]# last

root?????pts/1????????:0.0?????????????Thu Mar 24 19:04???still logged in??

root?????:0????????????????????????????Thu Mar 24 19:02???still logged in??

root?????:0????????????????????????????Thu Mar 24 19:02 - 19:02??(00:00)???

reboot???system boot??2.6.18-164.el5???Fri Mar 25 03:00??????????(-7:-4)???

root?????:0????????????????????????????Mon Mar 21 20:24 - crash (3+06:35)??

root?????:0????????????????????????????Mon Mar 21 20:24 - 20:24??(00:00)???

reboot???system boot??2.6.18-164.el5???Tue Mar 22 03:33?????????(2+16:22)??

?

wtmp begins Tue Mar 22 03:33:26 2011

# cut -d: -f1 /etc/passwd???#?查看系統(tǒng)所有用戶

# cut -d: -f1 /etc/group????#?查看系統(tǒng)所有組

# crontab -l?????????????#?查看當(dāng)前用戶的計劃任務(wù)服務(wù)

時程表的格式如下?:??f1 f2 f3 f4 f5 program

?

用VI編輯一個文件?cronfile,然后在這個文件中輸入格式良好的時程表。編輯完成后,保存并退出。

  在命令行輸入

  $: crontab cronfile

  這樣就將cronfile文件提交給c r o n進(jìn)程,同時,新創(chuàng)建cronfile的一個副本已經(jīng)被放在/ v a r / s p o o l / c r o n目錄中,文件名就是用戶名。

當(dāng)程式在你所指定的時間執(zhí)行后,系統(tǒng)會寄一封信給你,顯示該程式執(zhí)行的內(nèi)容,若是你不希望收到這樣的信,請在每一行空一格之后加上?> /dev/null 2>&1?即可

?

crontab -e

修改crontab

/etc/init.d/crond restart

需要root帳號

?

useradd user1

useradd user2

groupadd group1

gpasswd -a user1 group1

正在將用戶"user1"加入到"group1"組中

?

24、服務(wù)

# chkconfig --list???????#?列出所有系統(tǒng)服務(wù)

# chkconfig --list | grep on????#?列出所有啟動的系統(tǒng)服務(wù)程序

?

25、程序

# rpm -qa????????????????#?查看所有安裝的軟件包

?

26、中文亂碼

下載中文支持包:

fonts-chinese-3.02-12.el5.noarch中文字體包

fonts-ISO8859-2-75dpi-1.0-17.1.noarch字體顯示包

?

l??在安裝時的“supported language”里面打鉤?“Chinese?”,?即可。?要注意區(qū)分安裝使用的語言和支持的語言是兩回事。

或者

l??如果已經(jīng)安裝了,?可以?yum install fonts-chinese?來安裝中文字體。這樣,?firefox,?gedit就能正確顯示中文了?。

locale -a查看系統(tǒng)支持的語言

vi /etc/sysconfig/i18n

改成LANG="zh_CN.UTF-8"重啟即可

?

27、備份和恢復(fù)

恢復(fù)grub配置文件

先記住grub配置文件結(jié)構(gòu)

title Red Hat Enterprise Linux Server (2.6.18-164.el5)

?????????root(hd0,0)#表示要從系統(tǒng)中的第一塊硬盤的第一個分區(qū)去找配置文件

?????????kernel /vmlinuz-2.6.18-164.el5 ro root=LABEL=/ rhgb quiet

?????????#ro表示只讀的意思

?????????#LABEL=/表示在根目錄下查找

?????????initrd /initrd-2.6.18-164.el5.img

?

刪除/boot/grub/grub.conf

系統(tǒng)啟動不起來

啟動時可以使用下面命令

grub> root (hd0,0)

Filesystem type is ext2fs, partition type 0x83

?

grub> kernel /vmlinuz-2.6.18-164.el5 ro root=LABEL=/

[Linux-bzImage, setup=0x1e00, size=0x1c31d4]

?

grub> initrd /initrd-2.6.18-164.el5.img

[Linux-initrd @ 0x10c64000, 0x27b258 bytes]

?

28、系統(tǒng)啟動

linux啟動的時候,會在/boot目錄先

加載vmlinuz*內(nèi)核文件,然后加載initrd*內(nèi)存磁盤文件

?

注銷:logout

立即關(guān)機(jī):shutdown –h now

5分鐘后關(guān)機(jī):shutdown +5

在10:30關(guān)機(jī):shutdown 10:30

立即關(guān)閉系統(tǒng)并重啟:shutdown –r now

指定在23:59重啟:shutdown –r 23:59

reboot一般單獨使用就可以重啟系統(tǒng),也可以加上參數(shù)

-f參數(shù):不依正常的程序運行關(guān)機(jī),直接關(guān)閉系統(tǒng)并重新啟動計算機(jī)

-l參數(shù):在重新啟動之前關(guān)閉所有網(wǎng)絡(luò)接口

?

29、換行符

dos2unix把"\r\n"轉(zhuǎn)化成"\n",unixtodos把"\n"轉(zhuǎn)化成"\r\n"。

命令dos2unix和unix2dos的使用非常簡單,格式為:dos2unix filename

?

?

30、鏡像制作:

dd if=/dev/zero of=./win2003.img bs=1 count=0 seek=50G

?

31、格式化日期

[root@localhost rc5.d]# date +%Y/%m/%d

2011/05/17

?

[root@localhost rc5.d]# date +%H:%M

10:31

?

顯示指定年月的日歷表

cal [month] [year]

?

一鍵安裝ssh命令

ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa

?

32、自動啟動

[root@expedia-cloud ~]# chkconfig --list vncserver
vncserver?????? 0:off?? 1:off?? 2:off?? 3:off?? 4:off?? 5:off?? 6:off
[root@expedia-cloud ~]# chkconfig --level 5 vncserver on
[root@expedia-cloud ~]# chkconfig --list vncserver
vncserver?????? 0:off?? 1:off?? 2:off?? 3:off?? 4:off?? 5:on??? 6:off

?

33、創(chuàng)建用戶及用戶組

創(chuàng)建用戶
useradd hdp

創(chuàng)建密碼

passwd hdp

創(chuàng)建用戶組
groupadd hadoop


添加用戶到用戶組
gpasswd -a hdp hadoop

?

或者


先創(chuàng)建用戶組,然后直接把創(chuàng)建的用戶添加到組
groupadd hadoop
mkdir /tmp/test
useradd -G hadoop -d /tmp/test -M hdp
G:用戶所在的組 d:表示創(chuàng)建用戶的自己目錄的位置給予指定?
M:不建立默認(rèn)的自家目錄,也就是說在/home下沒有自己的目錄

chown hdp.hadoop /tmp/test ----這表示把/tmp/test的屬主定為hdp

chmod 750 /tmp/test ----7表示wrx 5表示rx 0表示什么權(quán)限都沒有

?

?

34、安裝GNOME

yum grouplist

yum groupinstall "GNOME Desktop Environment"

startx

?

35、拷貝指定目錄下的某種類型文件到另一個目錄

find /home/hdpusr/.ivy2/cache/ -name *.jar|xargs -I {} cp -r {} /tmp/jars/

?

36、刪除一個目錄下指定文件夾

find ./ -name .svn | xargs rm -rf

?

37、遠(yuǎn)程啟動firefox

such as: ssh -X?root@172.18.3.241?'/usr/bin/firefox'

詳見:http://zhengzhuangjie.iteye.com/admin/blogs/1681389

?

如果啟動時遇到以下錯誤:

[hdpusr@expedia-hdp1 bin]$ /usr/bin/firefox
Error: no display specified

?

編輯/etc/rc.local
添加如下內(nèi)容

export DISPLAY=:0
su chester -c 'nohup java -jar /usr/local/bin/selenium-server.jar &' root

?

38、firefox安裝flash plugin

yum install flash-plugin
rpm -ql flash-plugin

?

39、查看系統(tǒng)中現(xiàn)有的用戶和用戶組是否包含了mysql
grep -in mysql /etc/passwd /etc/group
其中/etc/passwd文件中每個用戶都有一個對應(yīng)的記錄行,它記錄了這個用戶的一些基本屬性。系統(tǒng)管理員經(jīng)常會接觸到這個文件的修改以完成對用戶的管理工作。這個文件對所有用戶都是可讀的。

執(zhí)行上述命令,-i參數(shù)不區(qū)分大小寫,如果你沒有看到包含mysql的信息,則說明你的系統(tǒng)當(dāng)前可能沒有配置mysql,下面我們需要為mysql運行創(chuàng)建用戶及組。如果你看到結(jié)果返回 mysql 的字樣,說明mysql運行的帳戶信息己建立好了,那么可以跳過下面這一步。

?

40、查看linux系統(tǒng)默認(rèn)分隔符

[checker@localhost shell]$ set | grep IFS
IFS=$' \t\n'

?

41、ulimit

[hdpusr@expedia-hdp2 bin]$ ulimit -a
core file size????????? (blocks, -c) 0
data seg size?????????? (kbytes, -d) unlimited
scheduling priority???????????? (-e) 0
file size?????????????? (blocks, -f) unlimited
pending signals???????????????? (-i) 30235
max locked memory?????? (kbytes, -l) 64
max memory size???????? (kbytes, -m) unlimited
open files????????????????????? (-n) 1024
pipe size??????????? (512 bytes, -p) 8
POSIX message queues???? (bytes, -q) 819200
real-time priority????????????? (-r) 0
stack size????????????? (kbytes, -s) 10240
cpu time?????????????? (seconds, -t) unlimited
max user processes????????????? (-u) 1024
virtual memory????????? (kbytes, -v) unlimited
file locks????????????????????? (-x) unlimited
其中 "open files (-n) 1024 "是Linux操作系統(tǒng)對一個進(jìn)程打開的文件句柄數(shù)量的限制(也包含打開的SOCKET數(shù)量,可影響MySQL的并發(fā)連接數(shù)目).
若要令修改CentOS ulimits的數(shù)值永久生效,則必須修改配置文檔/etc/security/limits.conf,
比如
* soft nofile 32768
* hard nofile 65536
如果你使用squid的話,你要在/etc/init.d/squid的文件加入CentOS ulimit -HSn 65535.另外,在squid.conf中也要加入max_filedesc 16384
修改后,重新登錄后就立刻生效

轉(zhuǎn)載于:https://www.cnblogs.com/nishilunhui/archive/2012/12/13/2816350.html

創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎

總結(jié)

以上是生活随笔為你收集整理的CentOS 命令大全 (转)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。