ImageVerifierCode 换一换
格式:DOCX , 页数:26 ,大小:30.48KB ,
资源ID:6223395      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-6223395.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(CentOS常用命令.docx)为本站会员(b****4)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

CentOS常用命令.docx

1、CentOS常用命令一:使用CentOS常用命令查看cpu more /proc/cpuinfo | grep model name grep model name /proc/cpuinfo rootlocalhost /# 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 如果觉得需要看的更加舒服 grep model name /proc/cpuinfo | cut -f

2、2 -d: 二:使用CentOS常用命令查看内存 grep MemTotal /proc/meminfo grep MemTotal /proc/meminfo | cut -f2 -d: free -m |grep Mem | awk print $2 三:使用CentOS常用命令查看cpu是32位还是64位 查看CPU位数(32 or 64) getconf LONG_BIT 四:使用CentOS常用命令查看当前linux的版本 more /etc/redhat-release cat /etc/redhat-release 五:使用CentOS常用命令查看内核版本 uname -r un

3、ame -a 六:使用CentOS常用命令查看当前时间 date上面已经介绍如何同步时间了 七:使用CentOS常用命令查看硬盘和分区 df -h fdisk -l 也可以查看分区 du -sh 可以看到全部占用的空间 du /etc -sh 可以看到这个目录的大小 八:使用CentOS常用命令查看安装的软件包 查看系统安装的时候装的软件包 cat -n /root/install.log more /root/install.log | wc -l 查看现在已经安装了那些软件包 rpm -qa rpm -qa | wc -l yum list installed | wc -l 不过很奇怪,

4、我通过rpm,和yum这两种方式查询的安装软件包,数量并不一样。没有找到原因。 九:使用CentOS常用命令查看键盘布局 cat /etc/sysconfig/keyboard cat /etc/sysconfig/keyboard | grep KEYTABLE | cut -f2 -d= 十:使用CentOS常用命令查看selinux情况 sestatus sestatus | cut -f2 -d: cat /etc/sysconfig/selinux 十一:使用CentOS常用命令查看ip,mac地址 在ifcfg-eth0 文件里你可以看到mac,网关等信息。 ifconfig ca

5、t /etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR cat /etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR | cut -f2 -d= ifconfig eth0 |grep inet addr: |awk print $2|cut -c 6- ifconfig | grep inet addr:| grep -v 127.0.0.1 | cut -d: -f2 | awk print $1 查看网关 cat /etc/sysconfig/network 查看dns

6、cat /etc/resolv.conf 十二:使用CentOS常用命令查看默认语言 echo $LANG $LANGUAGE cat /etc/sysconfig/i18n 十二:使用CentOS常用命令查看所属时区和是否使用UTC时间 cat /etc/sysconfig/clock 十三:使用CentOS常用命令查看主机名 hostname cat /etc/sysconfig/network 修改主机名就是修改这个文件,同时最好也把host文件也修改。 十四:使用CentOS常用命令查看开机运行时间 uptime 09:44:45 up 67 days, 23:32, . 看来刚才确实

7、是网段的问题,我的机器还是67天前开机的。 #系统资源使用情况 vmstat 1 -S m procs -memory- -swap- -io- -system- -cpu- r b swpd free buff cache si so bi bo in cs us sy id wa st 0 0 0 233 199 778 0 0 4 25 1 1 3 0 96 0 0 0 0 0 233 199 778 0 0 0 0 1029 856 13 1 86 0 0 十五:使用CentOS常用命令查看开机运行时间 uptime 09:44:45 up 67 days, 23:32, . 看来刚才

8、确实是网段的问题,我的机器还是67天前开机的。 #系统资源使用情况 1. vmstat 1 -S m 2. procs -memory- -swap- -io- -system- -cpu- 3. r b swpd free buff cache si so bi bo in cs us sy id wa st 4. 0 0 0 233 199 778 0 0 4 25 1 1 3 0 96 0 0 5. 0 0 0 233 199 778 0 0 0 0 1029 856 13 1 86 0 0 6. 对大家推荐很好使用的Linux CentOS系统,像让大家对Linux CentOS系统有

9、所了解,然后对Linux CentOS系统全面讲解介绍,希望对大家有用Linux CentOS常用的命令. wget$ wget -r -np -nd 这条命令可以下载 网站上 packages 目录中的所有文件。Linux CentOS其中,-np 的作用是不遍历父目录,-nd 表示不在本机重新创建目录结构。 $ wget -r -np -nd -accept=iso 与上一条命令相似,Linux CentOS但多加了一个 -accept=iso 选项,这指示 wget 仅下载 i386 目录中所有扩展名为 iso 的文件。你也可以指定多个扩展名,Linux CentOS只需用逗号分隔即可。

10、 $ wget -i filename.txt 此命令常用于批量下载的情形,Linux CentOS把所有需要下载文件的地址放到 filename.txt 中,然后 wget 就会自动为你下载所有文件了。 Linux CentOS$ wget -c 这里所指定的 -c 选项的作用为断点续传。 $ wget -m -k (-H) 该命令可用来镜像一个网站,wget 将对链接进行转换。Linux CentOS如果网站中的图像是放在另外的站点,那么可以使用 -H 选项。 VI 编辑命令命令模式 移动光标 Ctrl + f 屏幕向下移动一页,相当于 Page Down按键 Ctrl + b 屏幕向上移

11、动一页,相当于 Page Up 按键 n n 表示数字。按下数字后再按空白鍵,光标会向右移动这一行的 n 个字元 0 数字 0 :移动到这一行的最前面字元处 $ 移动到这一行的最后面字元处 G 移动到这个文件的最后一行 nG n 为数字。移动到这个文件的第 n 行(可配合 :set nu) gg 移动到这个文件的第一行,相当于 1G n n 为数字。光标向下移动 n 行 Linux CentOS查找与替换 n 重复前一个查找的动作 N 与 n 刚好相反,为反向进行前一个查找动作 :n1,n2s/word1/word2/g n1 与 n2 均为数字。在第 n1 与 n2 行之间查找 word1

12、字符串,并将该字符串替换为 word2。 如:在 1 到 9 行之间查找 eric4ever 并替换为 ERIC4EVER 则::1,9s/eric4ever/ERIC4EVER/g :1,$s/word1/word2/g 从第一行到最后一行查找 word1 字符串,并将该字符串替换为 word2 :1,$s/word1/word2/gc 从第一行到最后一行查找 word1 字符串,并将该字符窗替换为 word2,替换前显示提示对话框是否确认替换 Linux CentOS删除、复制与粘贴 x, X 在一行字当中,x 为向后刪除一个字元 (相当于 del 按键), X 为向前刪除一个字元(相当于

13、 backspace 按键) dd 刪除光标所在的那一整行 ndd n 为数字。刪除光标所在的向下 n 列 yy 复制光标所在的那一行 nyy n 为数字。复制光标所在的向下 n 列 p, P p 为将已复制的内容粘贴在光标下一行上,P 则为粘贴在光标的上一行 u 还原前一个动作 Ctrl+r 重做上一个动作 . 小数点,意思是重复前一个动作 Linux CentOS编辑模式i, I 插入:在目前的光标所在处插入输入的文字,已存在的文字会向后退; 其中, i 为从目前光标所在处插入, I 为在目前所在行的第一個非空白字元处开始插入a, A a 为从目前光标所在的下一个字元处开始插入, A 为从

14、光标所在行的最后一个字元处开始插入 o, O o 为在目前光标所在的下一行处插入新的一行, O 为在目前光标所在处的上一行插入新的一行 r, R r 为取代光标所在的那一个字元, R 为一直取代光标所在的文字,直到按下 ESC 为止 Esc 退出编辑模式,回到一般模式中 Linux CentOS末行指令模式 :w 将编辑的文件写入到硬盘上 :q 退出 vi :set nu 显示行号 :set nonu 取消显示行号 Linux CentOSvim 块操作 Ctrl+v 进入视图模式 退出视图模式 在Ctrl+v 后: + A在块的每行末尾添加 I 插入 y 块抽取 p 块粘贴 c 修改 Lin

15、ux centos已被广泛应用但是也在不断的更新,这里介绍Linux centos安装设置使用,帮助大家安装更新Linux centos系统手动配置Linux centos的IP地址 今天在vmware server上装了个centos-4.7(免费的redhat,是小红帽的的克隆版本,跟小红帽的版本是对应的),其中ip安装时没设好,一般Linux centos的网卡IP地址是存放在文件中的,这个配置文件在/etc/sysconfig/network-scripts下, 名称分别为ifcfg-eth0,ifcfg-eth1.如果你有一块网卡,就只有ifcfg-eth0一个文件,如果你有两块或者

16、两块以上的网卡,就会有ifcfg-eth1、ifcfg-eth2等文件的出现。 文件结构: DEVICE=eth0 /指出设备名称 ONBOOT=yes/是否启动应用 BOOTPROTO=static /启动类型 静态 (默认dhcp) IPADDR=192.168.0.77 /IP地址 NETMASK=255.255.255.0/子网掩码 GATEWAY=192.168.0.1 /网关 步骤: 1、vi /etc/sysconfig/network-scripts/ifcfg-teh0 (也可通过管理工具setup或netconfig命令设置) 2、重新启动网络服务service netwo

17、rk restart 要想和主机连接:还需配置xp主机,在vmware上设置为 host-only模式,xp里修改vmnet1的IP地址为192.168.0.1, 修改Linux centos IP为192.168.0.77 共享上网设置:xp里修改第一块虚拟网卡的网络属性为共享internet(属性-高级-钩选“允许其他网络用户通过此计算机的Internet连接来连接”) 会自动把vmnet1改为192.168.0.1,Linux centos就能上网了 CentOS Vsftpd配置经过长时间的发展,这里我发表一下个人理解,下面就这就来讲术CentOS Vsftpd配置。调整CentOS

18、Vsftpd配置文件: 1.编辑CentOS Vsftpd配置文件前先备份 rootKcentOS5 cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.backup 2.编辑主CentOS Vsftpd配置文件Vsftpd.conf rootKcentOS5 vi /etc/vsftpd/vsftpd.conf 这里我将原CentOS Vsftpd配置文件的修改完全记录,凡是修改的地方我都会保留注释原来的配置。其中加入我对每条配置项的认识,对于一些比较关键的配置项这里我做了我的观点,并且原本英语的说明我也不删除,供参考对比用。 Example

19、 config file /etc/vsftpd/vsftpd.conf The default compiled in settings are fairly paranoid. This sample file loosens things up a bit, to make the ftp daemon more usable. Please see vsftpd.conf.5 for all compiled in defaults. READ THIS: This example file is NOT an exhaustive list of vsftpd options. Pl

20、ease read the vsftpd.conf.5 manual page to get a full idea of vsftpds capabilities. Allow anonymous FTP? (Beware - allowed by default if you comment this out). anonymous_enable=YES anonymous_enable=NO 设定不允许匿名访问 Uncomment this to allow local users to log in. local_enable=YES设定本地用户可以访问。注意:主要是为虚拟宿主用户,如

21、果该项目设定为NO那么所有虚拟用户将无法访问。 Uncomment this to enable any form of FTP write command. write_enable=YES 设定可以进行写操作。 Default umask for local users is 077. You may wish to change this to 022, if your users expect that (022 is used by most other ftpds) local_umask=022 设定上传后文件的权限掩码。 Uncomment this to allow the

22、anonymous FTP user to upload files. This only has an effect if the above global write enable is activated. Also, you will obviously need to create a directory writable by the FTP user. anon_upload_enable=YES anon_upload_enable=NO 禁止匿名用户上传。 Uncomment this if you want the anonymous FTP user to be able

23、 to create new directories. anon_mkdir_write_enable=YES anon_mkdir_write_enable=NO 禁止匿名用户建立目录。 Activate directory messages - messages given to remote users when they go into a certain directory. dirmessage_enable=YES 设定开启目录标语功能。 Activate logging of uploads/downloads. xferlog_enable=YES 设定开启日志记录功能。 M

24、ake sure PORT transfer connections originate from port 20 (ftp-data). connect_from_port_20=YES 设定端口20进行数据连接。 If you want, you can arrange for uploaded anonymous files to be owned by a different user. Note! Using root for uploaded files is not recommended! chown_uploads=YES chown_uploads=NO 设定禁止上传文件更

25、改宿主。 chown_username=whoever You may override where the log file goes if you like. The default is shown below. xferlog_file=/var/log/vsftpd.log 设定CentOS Vsftpd配置的服务日志保存路径。注意,该文件默认不存在。必须要手动touch出来,并且由于这里更改了CentOS Vsftpd配置的服务宿主用户为手动建立的Vsftpd。必须注意给与该用户对日志的写入权限,否则服务将启动失败。 If you want, you can have your l

26、og file in standard ftpd xferlog format xferlog_std_format=YES 设定日志使用标准的记录格式。 You may change the default value for timing out an idle session. idle_session_timeout=600 设定空闲连接超时时间,这里使用默认。将具体数值留给每个具体用户具体指定,当然如果不指定的话,还是使用这里的默认值600,单位秒。 You may change the default value for timing out a data connection.

27、data_connection_timeout=120 设定单次最大连续传输时间,这里使用默认。将具体数值留给每个具体用户具体指定,当然如果不指定的话,还是使用这里的默认值120,单位秒。 It is recommended that you define on your system a unique user which the ftp server can use as a totally isolated and unprivileged user. nopriv_user=ftpsecure nopriv_user=vsftpd 设定支撑CentOS Vsftpd服务的宿主用户为手动

28、建立的Vsftpd用户。注意,一旦做出更改宿主用户后,必须注意一起与该服务相关的读写文件的读写赋权问题。比如日志文件就必须给与该用户写入权限等。 Enable this and the server will recognise asynchronous ABOR requests. Not recommended for security (the code is non-trivial). Not enabling it, however, may confuse older FTP clients. async_abor_enable=YES 设定支持异步传输功能。 By default

29、 the server will pretend to allow ASCII mode but in fact ignore the request. Turn on the below options to have the server actually do ASCII mangling on files when in ASCII mode. Beware that on some FTP servers, ASCII support allows a denial of service attack (DoS) via the command SIZE /big/file in A

30、SCII mode. vsftpd predicted this attack and has always been safe, reporting the size of the raw file. ASCII mangling is a horrible feature of the protocol. ascii_upload_enable=YES ascii_download_enable=YES 设定支持ASCII模式的上传和下载功能。 You may fully customise the login banner string: ftpd_banner=This Vsftp server supports virtual users _ 设定CentOS Vsftpd配置的登陆标语。 You may specify a file of disallowed anonymous e-

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2