zoukankan      html  css  js  c++  java
  • 逐步深入Linux(一)- 基础命令

    1.登录 ssh

    ssh 登录名@ip 

    示例:

    ssh root@192.168.6.128

    回车

    输入密码:******

    Last login: Fri Jul  9 11:24:56 2021

    2. 安装程序 yum -y install

    示例:

    yum -y install vsftpd
    已安装:
      vsftpd-3.0.3-33.el8.x86_64

    3.查看是否安装程序   rpm -qa |grep 程序名

    示例:

    rpm -qa |grep vsftp
    vsftpd-3.0.3-33.el8.x86_64

    4.服务操作 service 程序名 status|start|stop|restart

    示例:

    service vsftpd status
    Redirecting to /bin/systemctl status vsftpd.service
    ● vsftpd.service - Vsftpd ftp daemon
       Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled; vendor preset: disabled)
       Active: active (running) since Fri 2021-07-09 13:57:55 CST; 1h 3min ago
      Process: 34791 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf (code=exited, status=0/SUCCESS)
     Main PID: 34792 (vsftpd)
        Tasks: 1 (limit: 4623)
       Memory: 644.0K
       CGroup: /system.slice/vsftpd.service
               └─34792 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf

    5.查看端口使用情况 netstat -nlpt

    示例:

    netstat -nlpt
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/systemd
    tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      1673/dnsmasq
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1055/sshd
    tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      1056/cupsd
    tcp6       0      0 :::111                  :::*                    LISTEN      1/systemd
    tcp6       0      0 :::21                   :::*                    LISTEN      35570/vsftpd
    tcp6       0      0 :::22                   :::*                    LISTEN      1055/sshd
    tcp6       0      0 ::1:631                 :::*                    LISTEN      1056/cupsd

    6.列出文件夹详细信息 ll

    示例:

    ll
    -rw-------. 1 root root  125 11月 17 2020 ftpusers
    -rw-------. 1 root root  361 11月 17 2020 user_list
    -rw-------. 1 root root 5039 11月 17 2020 vsftpd.conf
    -rwxr--r--. 1 root root  348 11月 17 2020 vsftpd_conf_migrate.sh

    7.输出当前目录 pwd

    示例:

    pwd
    /etc/vsftpd

    8.查看文件内容 cat 文件名

    示例:

    cat ftpusers
    # Users that are not allowed to login via ftp
    root
    bin
    daemon
    adm
    lp
    sync
    shutdown
    halt
    mail
    news
    uucp
    operator
    games
    nobody

    9.设置开机启动 chkconfig 程序名 on

    示例:

    chkconfig vsftpd on
    注意:正在将请求转发到“systemctl enable vsftpd.service”。
    Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /usr/lib/systemd/system/vsftpd.service.

    10. 跳转目录 cd 路径|..

    示例:

    cd /etc/vsftpd

    11.编辑文件 vi 文件路径

    示例:

    vi /etc/vsftpd/vsftpd.conf

    如何退出保存,按ESC键进入命令模式

    :w?? // 保存文件但不退出vi
    
    :w 文件名 // 将修改另外保存到文件名中,不退出vi
    
    :w! // 强制保存,不退出vi
    
    :wq // 保存文件并退出vi
    
    :wq! // 强制保存文件,并退出vi
    
    :q // 不保存文件,退出vi
    
    :q! // 不保存文件,强制退出vi
    
    :e! // 放弃所有修改,从上次保存文件开始再编辑

    本文来自博客园,作者:技术宅的化身,转载请注明原文链接:https://www.cnblogs.com/Zyj12/p/14991011.html

  • 相关阅读:
    C#打造51CTO自动签到服务领取无忧币之开篇
    Windows8开发实战之文本布局
    设计模式之抽像工厂
    PDM只显示表名称不显示列表名称
    JS 判断中英文字符长度
    C#操作剪贴板实现复制粘贴
    Chrome控制台设置浏览器Cookie
    通过Mysql查询分析器 建库建表语句
    推荐两个VS开发工具插件
    C#经典机试题(猫叫)
  • 原文地址:https://www.cnblogs.com/Zyj12/p/14991011.html
Copyright © 2011-2022 走看看