zoukankan      html  css  js  c++  java
  • Linux常用命令

    vi编辑:

    跳转到最后一行:G,就是shift + g
    跳转到首行 gg

    跳转到当前行的第一个字符:在当前行按“0”
    跳转到当前行的末尾:$,就是shift + 4

    删除全部内容:
    1.输入gg进入到第1行
    2.按下d,然后输入G回车,此时内容被全部清除

    删除非空目录不提示:rm -rf abc

    语法:tar [-zjxcvfpP] filename
    -z :是否同时用gzip压缩
    -j :是否同时用bzip2压缩
    -x :解包或者解压缩
    -t :查看tar包里面的文件
    -c :建立一个tar包或者压缩文件包
    -v :可视化
    -f :后面跟文件名,压缩时跟-f文件名,意思是压缩后的文件名为filename,解压时跟-f文件名,意思是解压filename。请注意,如果是多个参数组合的情况下带有-f,请把f写到最后面

    对目录abc进行打包压缩:tar -zcvf abc.tar.gz abc/
    查看压缩包文件:tar -tf abc.tar.gz
    对abc.tar.gz解压:tar -zxvf abc.tar.gz


    下载test.rpm文件到指定目录而不安装
    yum install -y yum-downloadonly.noarch
    yum install test.rpm -y --downloadonly --downloaddir=/usr/local/src

    查看开机启动项:
    systemctl list-unit-files |grep enabled
    systemctl list-unit-files --type=service | grep enabled

    vi /etc/rc.local

    禁用开机启动项:
    systemctl stop bluetooth.service
    systemctl disable bluetooth.service

    杀死服务:
    systemctl kill httpd


    查看防火墙状态:systemctl status firewalld
    永久关闭防火墙:systemctl stop firewalld; systemctl disable firewalld


    #开放5044端口
    /sbin/iptables -I INPUT -p TCP --dport 5044 -j ACCEPT

    #查找5044端口状态
    iptables -nL |grep 5044

    iptables永久保存:https://blog.csdn.net/weixin_42497941/article/details/105219278

  • 相关阅读:
    CodeForces
    [SDOI2018] 战略游戏
    bzoj3786: 星系探索
    bzoj4383: [POI2015]Pustynia
    bzoj4353: Play with tree
    bzoj4336: BJOI2015 骑士的旅行
    bzoj4381: [POI2015]Odwiedziny
    codechef January Lunchtime 2017简要题解
    bzoj 3867: Nice boat
    3069: [Pa2011]Hard Choice 艰难的选择
  • 原文地址:https://www.cnblogs.com/dreamer-fish/p/15094657.html
Copyright © 2011-2022 走看看