摘要: 删除第2行 nl /etc/passwd|sed '2d' 删除第3行到最后一行 nl /etc/passwd|sed '3,$d' 在第2行后加上字符串drink tea nl /etc/passwd|sed '2a drink tea' 在第2行前加上字符串drink tea nl /etc/p 阅读全文
posted @ 2017-05-03 16:49 enginex 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 关键词显示颜色,且加上行号 dmesg|grep -n --color=auto 'eth' 将关键词所在行的前2行和后3行,也一起显示 dmesg|grep -n -A3 -B2 --color=auto 'eth' 自动将关键词加上颜色 vim ~/.bashrc alias grep='gre 阅读全文
posted @ 2017-05-03 16:48 enginex 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 一、实验要求 有三个账户smb1、smb2、smb3,都属于users群组 三个账户的linux密码均为1234,samba密码为4321 samba服务分享/home/project目录,资源共享名为project 三个账户可使用project资源,且users群组的成员对project具有写入权 阅读全文
posted @ 2017-05-03 16:47 enginex 阅读(6058) 评论(0) 推荐(0) 编辑
摘要: 一、服务器配置 安装:yum install -y samba 更改要共享的path权限:chmod 777 /mnt/samba/ 先备份smb.conf配置文件:cp /etc/samba/smb.conf /etc/samba/smb.conf.bak 更改配置:vim /etc/samba/ 阅读全文
posted @ 2017-05-03 16:46 enginex 阅读(8035) 评论(0) 推荐(0) 编辑
摘要: 一、设备 家有老式笔记本一台 HP F2288打印机一台(无网卡模块) 能上网的路由器 二、准备 笔记本安装CentOS 6.4 x64系统(linux适合老式机子,开机比windows快多了) 到HPLIP官网(http://hplipopensource.com/hplip-web/index. 阅读全文
posted @ 2017-05-03 16:45 enginex 阅读(14955) 评论(0) 推荐(0) 编辑
摘要: 安装:yum install -y dhcp* 关闭selinux 服务器配置静态IP:BOOTPROTO=static IPADDR=192.168.100.1 NETMASK=255.255.255.0 GATEWAY=192.168.100.250 配置:cp /usr/...dhcpd.co 阅读全文
posted @ 2017-05-03 16:44 enginex 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 一、NTP服务器(IP:192.168.1.101) 安装:yum install -y ntp 防火墙允许:iptables -A INPUT -i $EXTIF -p udp -s 192.168.1.0/24 --dport 123 -j ACCEPT 配置:vim /etc/ntp.conf 阅读全文
posted @ 2017-05-03 16:43 enginex 阅读(394) 评论(0) 推荐(0) 编辑
摘要: 变量赋值 myname=VBird 2. 变量显示 echo $myname 3. 双引号内特殊字符保持原有特性:var="lang is $LANG",得var为lang is en_US 4. 单引号内特殊字符仅为一般字符:var='lang is $LANG',得var为lang is $LA 阅读全文
posted @ 2017-05-03 16:42 enginex 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 下翻一页:page down 上翻一页:page up 到行首:home 到行尾:end 移动到档案尾:G 移动到档案头:gg 光标向下移动n行:n <enter> 在下面插入新的一行:o 在上面插入新的一行:O 向下搜索word字符串:/word 再按n:向下搜索 再按N: 向上搜索 在n1与n2 阅读全文
posted @ 2017-05-03 16:41 enginex 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 打包并压缩 tar -zpcvf /root/etc.tar.gz /etc/ 2. 查看压缩包内容 tar -tvf etc.tar.gz 3.解压到指定目录 tar -xvf etc.tar.gz -C /tmp/ 4.用dd备份/还原partition/disk dd if=/dev/sda1 阅读全文
posted @ 2017-05-02 21:39 enginex 阅读(166) 评论(0) 推荐(0) 编辑