linux的常用命令

1、查看多少个用户
cat /etc/passwd|grep  /home
2、查看ntsysv指令有没安装,安装了在哪个目录
 find / -name "ntsysv" -print
3、解压gz文件:tar -zxvf /tmp/etc.tar.gz
4、重启PHP服务 service httpd restart
5、修改为只读:chmod u-w license.key
5、修改为可写:chmod u+w license.key
6、清空iptables:
    a、进入iptables目录:cd /etc/sysconfig
    b、iptabels备份:cp iptables iptables20110507
    C、iptables清空:vi iptables (使用“DD”删除,然后按“:wq”保存退出)
7、iptables停止: /etc/init.d/iptables stop (停止了如果重启linux这个服务会自动开启)
8、iptables重启: /etc/init.d/iptables restart
9、ssh重启:     /etc/init.d/sshd restart
10、httpd 重启: /etc/init.d/httpd restart (apache服务)
11、查看linux是不是64位:getconf WORD_BIT
12、压缩tar: tar -cvf test20110930.tar  test(将当前的test目录下打包成test20110930.tar)
    解压tar: tar -xvf  test20110930.tar (解压tar包)
13、查看文件中出现某个单词的次数:grep -c hello 文件名
  (如 grep -c hello aa.txt,查看aa.txt中出现多少个hello单词)
14、linux 在vi中前面加数字编号
   vi txt.ini 后,按“Esc”键,然后输入“:”,再输入“set number”。
15、输入一个文件中每一行的从第N个字符到第M个字符
    cut -b 1-5 filename  (输入文件filename中每行第1到5个字符)
16、查询文件的类型
    file filename
17、对文件中的每一行按照第一个字母进行排序
    sort  filename (如filename中三行分别为bb、aa、cc,使用命令后变成aa、bb、cc
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值