• linux 常用操作命令


    PGSQL数据库
    1、连接数据库
    psql -U twpaas -h 192.168.102.106 -p 8832
    
    192.168.102.106:8832/twpaas
    twpaas / twpaasuseR@2017
    
    2、选择/切换数据库
     c twpaas
    
    
    查找文件
    find /usr/tmp -name 'a*'    查找/usr/tmp目录下的所有以a开头的目录或文件
    
    压缩解压缩
    压缩文件
    tar -zcvf test.tar *
    解压文件
    tar -zxvf test.tar 
    tar -zxvf test.tar -C ./test
    
    centos7防火墙管理
    安装防火墙
    yum install firewalld systemd -y
    查看已经开放的端口:
    firewall-cmd --list-ports
    开放端口
    firewall-cmd --zone=public --add-port=80/tcp --permanent
    重启防火墙:
    systemctl reload firewalld
    ① systemctl status firewalld
    查看firewalld状态,发现当前是dead状态,即防火墙未开启。
    
     

     

    SQL方式查看表结构及字段信息

    SELECT a.attnum, a.attname AS field, t.typname AS type, a.attlen AS length, a.atttypmod AS lengthvar
        , a.attnotnull AS notnull, b.description AS comment
    FROM pg_class c, pg_attribute a
        LEFT JOIN pg_description b
        ON a.attrelid = b.objoid
            AND a.attnum = b.objsubid, pg_type t
    WHERE c.relname = '实际的表名'
        AND a.attnum > 0
        AND a.attrelid = c.oid
        AND a.atttypid = t.oid
    ORDER BY a.attnum;

    ② systemctl start firewalld
    开启防火墙,没有任何提示即开启成功。
    再次通过systemctl status firewalld查看firewalld状态,显示running即已开启了。

    ③ systemctl stop firewalld
    如果要关闭防火墙设置,可能通过systemctl stop firewalld这条指令来关闭该功能。
    编程PDF电子书免费下载: http://www.shitanlife.com/code 每天学习一点点
  • 相关阅读:
    Codeforces 469D Two Sets
    Codeforces1249D2 Too Many Segments (hard version)
    Codeforces 796D Police Stations
    Codeforces 617E XOR and Favorite Number
    Codeforces 900D Unusual Sequences
    Python底层(一):列表
    最短路径笔记(一):Floyd
    竞赛题笔记(二):剪邮票
    图论题笔记(三):最少中转次数
    图论题笔记(二):城市地图
  • 原文地址:https://www.cnblogs.com/scode2/p/15375031.html
Copyright © 2020-2023  润新知