linux常用命令

查看系统信息

查看内核/操作系统/CPU信息 uname -a

# 查看内核/操作系统/CPU信息 
[root@localhost log]# uname --help
  -a, --all                     以如下次序输出所有信息。其中若-p 和
                                -i 的探测结果不可知则被省略:
  -s, --kernel-name             输出内核名称
  -n, --nodename                输出网络节点上的主机名
  -r, --kernel-release          输出内核发行号
  -v, --kernel-version          输出内核版本
  -m, --machine         输出主机的硬件架构名称
  -p, --processor               输出处理器类型或"unknown"
  -i, --hardware-platform       输出硬件平台或"unknown"
  -o, --operating-system        输出操作系统名称
      --help            显示此帮助信息并退出
      --version         显示版本信息并退出
[root@localhost log]# uname -a
Linux localhost.docker.demo 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC
[root@localhost log]# uname -s
Linux
[root@localhost log]# uname -n
localhost.docker.demo
[root@localhost log]# uname -r
3.10.0-957.el7.x86_64
[root@localhost log]# uname -v
#1 SMP Thu Nov 8 23:39:32 UTC 2018
[root@localhost log]# uname -m
x86_64
[root@localhost log]# uname -p
x86_64
[root@localhost log]# uname -i
x86_64
[root@localhost log]# uname -o
GNU/Linux

查看操作系统版本 cat /etc/redhat-release

[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

查看CPU信息 cat /proc/cpuinfo

[root@localhost ~]# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 142
model name      : Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
stepping        : 10
microcode       : 0xc6
cpu MHz         : 1800.000
cache size      : 6144 KB
physical id     : 0
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 22
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch epb fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap xsaveopt dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp
bogomips        : 3600.00
clflush size    : 64
cache_alignment : 64
address sizes   : 42 bits physical, 48 bits virtual
power management:

查看计算机名 hostname

[root@localhost ~]# hostname
localhost.docker.demo

hostnamectl 查看linux虚拟机信息

[root@localhost ~]# hostnamectl
   Static hostname: localhost.localdomain
         Icon name: computer-vm
           Chassis: vm
        Machine ID: ef3f62a4489d43e5bf915bbe0683d8a9
           Boot ID: 8f43cdd6371b46f1ad8701e57530dfa6
    Virtualization: vmware
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-1062.el7.x86_64
      Architecture: x86-64

查看环境变量 env

查看系统运行资源

查看内存信息 free -h

[root@localhost ~]# free --help
 -h, --human         show human-readable output
 -m, --mega          show output in megabytes
 -l, --lohi          show detailed low and high memory statistics
 -t, --total         show total for RAM + swap
 -s N, --seconds N   repeat printing every N seconds
[root@localhost ~]# free -h
              total        used        free      shared  buff/cache   available
Mem:           1.8G        1.0G         68M        345M        688M        185M
Swap:          2.0G        503M        1.5G
[root@localhost ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:           1819        1062          68         342         688         188
Swap:          2047         502        1545
[root@localhost ~]# free -tlhs 3
              total        used        free      shared  buff/cache   available
Mem:           1.8G        1.0G         67M        345M        688M        184M
Low:           1.8G        1.7G         67M
High:            0B          0B          0B
Swap:          2.0G        503M        1.5G
Total:         3.8G        1.5G        1.6G
  • total: 内存总数
  • used: 已经使用内存数
  • free: 完全空闲内存
  • shared: 多个进程共享的内存
  • buffers: 用于块设备数据缓冲,记录文件系统metadata(目录,权限,属性等)
  • cached: 用于文件内容的缓冲
  • available:真正剩余的可被程序应用的内存数

查看各分区使用情况 df -h

[root@localhost ~]# df -h
文件系统                 容量  已用  可用 已用% 挂载点
/dev/mapper/centos-root   17G   17G   27M  100% /
devtmpfs                 898M     0  898M    0% /dev
tmpfs                    910M     0  910M    0% /dev/shm
tmpfs                    910M   90M  821M   10% /run
tmpfs                    910M     0  910M    0% /sys/fs/cgroup
/dev/sda1               1014M  146M  869M   15% /boot
overlay                   17G   17G   27M  100% /var/lib/docker/overlay2/a2888dd274ee0f4731a73eb1c758656e66091a4f4fbd19f0a5e980d70a055950/merged
shm                       64M     0   64M    0% /var/lib/docker/containers/b1882b92772afb5ae7400b5ce0a4211246f9172e9acab5139334add9f9f58d72/shm
tmpfs                    182M     0  182M    0% /run/user/0
overlay                   17G   17G   27M  100% /var/lib/docker/overlay2/51dbcc0f009bb99993cae6ada341592c57efc7065390fde5b73fcbc28ab221ec/merged
shm                       64M     0   64M    0% /var/lib/docker/containers/ee8cb63a90c9d474c0efc81239b2262f21ab82a573d58a3f2868ba286c5edd7c/shm
overlay                   17G   17G   27M  100% /var/lib/docker/overlay2/d38d8ef89307aa0081aac876a898b0b39cb2ba51991ff731e97af01d840fb437/merged
shm                       64M     0   64M    0% /var/lib/docker/containers/115e3a6d06011d6a393ab130424afb44055eb9810462fe267019a9224a556b4d/shm

查看指定目录的大小 du -sh ./*

[root@localhost src]# du --help
-h, --human-readable  print sizes in human readable format (e.g., 1K 234M 2G)
-s, --summarize       display only a total for each argument
[root@localhost src]# ls
nginx-1.16.0  nginx-1.16.0.tar.gz  nginx_related  solr-7.7.2.tgz
[root@localhost src]# du -sh ./
215M    ./
[root@localhost src]# du -sh ./*
19M     ./nginx-1.16.0
1012K   ./nginx-1.16.0.tar.gz
32M     ./nginx_related
164M    ./solr-7.7.2.tgz

查看内存相关信息 cat /proc/meminfo

[root@localhost ~]# cat /proc/meminfo
MemTotal:        1863224 kB
MemFree:           78908 kB
MemAvailable:     209124 kB
Buffers:               0 kB
Cached:           611012 kB
SwapCached:        56960 kB

查看系统运行时间、用户数、负载

[root@localhost ~]# uptime
 19:12:02 up  2:35,  2 users,  load average: 0.02, 0.09, 0.07

查看系统时间

[root@localhost ~]# timedatectl
      Local time: Fri 2021-05-28 11:20:15 UTC
  Universal time: Fri 2021-05-28 11:20:15 UTC
        RTC time: Fri 2021-05-28 11:20:15
       Time zone: n/a (UTC, +0000)
     NTP enabled: n/a
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a
--设置时间 重启永久生效
[root@localhost ~]# date -s "2021-5-28 11:15:00"
[root@localhost ~]# clock -w

top 用于实时显示 process 的动态

[root@localhost ~]# top
top - 23:37:46 up  6:31,  3 users,  load average: 0.00, 0.01, 0.05
Tasks: 105 total,   2 running, 103 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 us,  6.2 sy,  0.0 ni, 93.8 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  1863076 total,  1097064 free,   209232 used,   556780 buff/cache
KiB Swap:  2097148 total,  2097148 free,        0 used.  1491924 avail Mem

   PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND
     1 root      20   0  128048   6744   4192 S  0.0  0.4   0:02.00 systemd
     2 root      20   0       0      0      0 S  0.0  0.0   0:00.00 kthreadd
     4 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 kworker/0:0H

vmstat

服务器的CPU使用率,内存使用,虚拟内存交换情况,IO读写情况

[root@localhost ~]# vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 2  0      0 1098068   2108 554292    0    0    19     6   34   63  0  0 100  0  0

# 第一个参数,每隔5秒采样溢出, 第二个参数为采集次数, 第二个参数可以省略,表示一直采集
[root@localhost ~]# vmstat 5 3
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 2  0      0 1098068   2108 554292    0    0    19     6   34   63  0  0 100  0  0
 0  0      0 1098044   2108 554292    0    0     0     0   26   44  0  0 100  0  0
 0  0      0 1098044   2108 554292    0    0     0     0   26   44  0  0 100  0  0

nethogs 开源网络监视工具

[root@localhost ~]# yum install nethogs
[root@localhost ~]# sudo nethogs eth0 eth1
[root@localhost ~]# sudo nethogs -d 5

来自: http://lnmp.ailinux.net/nethogs

以下是NetHogs的一些交互命令(键盘快捷键) m : 修改单位 r : 按流量排序 s : 按发送流量排序 q : 退出命令提示符

用户

# 增加用户
[root@localhost /]# useradd test01
# 用户修改密码
[root@localhost /]# passwd test01
# 删除用户
[root@localhost /]# userdel test01
[root@localhost /]# rm -rf /home/test01/

查找文件文本

find

[tomcat@localhost ~]$ pwd
/home/tomcat

# 查找当前目录下, 以 *.txt 结尾的文件
[tomcat@localhost ~]$ find . -name  "*.txt"
./a.txt
./tomcat8/logs/localhost_access_log.2021-04-29.txt

# 当前目录及其子目录下所有最近 1 天内更新过的文件列出
[tomcat@localhost ~]$ find . -ctime -1
.
./tomcat8/logs/localhost_access_log.2021-04-29.txt
./a.txt

grep

# 当前目录中, 查找后缀有 .txt 字样的文件, 文件中包含 org 字符串的文件, 并打印出该字符串的行。
[tomcat@localhost ~]$ grep org *.txt
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)

# 以递归的方式查找符合条件的文件, 查找文本 org , 在目录 /home/tomcat 以及它的子目录
[tomcat@localhost ~]$ grep -r org /home/tomcat
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)

wc 计算文件的Byte数、字数、行数

 # 显示Bytes数
[tomcat@localhost ~]$ wc -c a.txt
65647 a.txt

# 显示行数
[tomcat@localhost ~]$ wc -l a.txt
1058 a.txt

# 只显示字数
[tomcat@localhost ~]$ wc -w a.txt
3040 a.txt

# 显示 行数,字数,Bytes数
[tomcat@localhost ~]$ wc a.txt
 1058  3040 65647 a.txt

awk 强大的文本分析工具

例子1

[root@localhost ~]# vi a.txt
grape orange pear apple
one two three four five

# 每行按 空格 或 TAB 分割,输出文本第1个和第3个单词
[root@localhost ~]# awk '{print $1,$3}' a.txt
grape pear
one three

例子2

[root@localhost ~]# vi b.txt
grape#orange#pear#apple
one#two#three#four#five

# 使用参数 -F ,指定分隔符 # ,输出文本第2个和第4个单词
[root@localhost ~]# awk -F# '{print $2,$4}' b.txt
orange apple
two four

例子3

# 输出包含 three 的行
[root@localhost ~]# awk /three/ a.txt
one two three four five

例子4

[root@localhost ~]$ free -h
              total        used        free      shared  buff/cache   available
Mem:           7.5G        2.7G        177M        101M        4.7G        4.5G
Swap:          8.0G         81M        7.9G

[root@localhost ~]$ free -h | awk '/Swap:/'
Swap:          8.0G         81M        7.9G

# swap交换空间 总内存         NR:已经读取的记录数
[root@localhost ~]$ free -h | awk '/Swap:/' | awk 'NR==1{print $2}'
8.0G

# swap交换空间 已用内存
[root@localhost ~]$ free -h | awk '/Swap:/' | awk 'NR==1{print $3}'
81M

# swap交换空间 空闲内存
[root@localhost ~]$ free -h | awk '/Swap:/' | awk 'NR==1{print $4}'
7.9G

挂载 mount

挂载win10共享文件夹

CIFS是一种通用网络文件系统,主要用于网络设备之间的文件共享。

[root@localhost ~]# yum install cifs-utils -y
[root@localhost ~]# mkdir /usr/local/app_share
[root@localhost ~]# mount //192.168.109.1/app_share /usr/local/app_share -o username=centos,password=123456

开机自动挂载

[root@localhost /]# vi /etc/fstab
//192.168.109.1/maven_resp /usr/local/maven_resp cifs defaults,auto,username=centos,password=123456 0 0

[root@localhost /]# mount -a

查看网络信息

设置DNS

[root@localhost ~]# vi /etc/resolv.conf
nameserver 114.114.114.114
nameserver 8.8.8.8

查看所有网络接口的属性 ifconfig / ip addr

查看防火墙设置 iptables -L

查看iptable规则设置情况

[root@localhost ~]# iptables -nL
Chain INPUT (policy ACCEPT)
Chain FORWARD (policy DROP)
Chain OUTPUT (policy ACCEPT)
  • --list -L [chain [rulenum]] List the rules in a chain or all chains
  • --numeric -n numeric output of addresses and ports
    用数字的形式输出 ip地址和端口

打开端口 8089

[root@localhost ~]# iptables -A INPUT -p tcp --dport 8089 -j ACCEPT
[root@localhost ~]# iptables -A OUTPUT -p tcp --sport 8089 -j ACCEPT
[root@localhost ~]# iptables -nL
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:8089
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp spt:8089
  • --append -A chain Append to chain
    添加一条 INPUT或者OUTPUT 的规则
  • --protocol -p proto protocol: by number or name, eg. tcp’
    指定协议,常用是tcp 协议 或者udp 协议,比如53端口的DNS要使用udp协议
  • --dport
    目标端口 当数据从外部进入服务器为目标端口
  • --sport
    源端口 数据从服务器出去
  • --jump -j target target for rule (may load target extension)
    -j 就是指定是 ACCEPT 接收 或者 DROP 不接收

查看防火墙设置 systemctl status firewalld

centos 7
放开端口:3306
删除端口:9999
接口转发:客户端访问80端口,服务器由80端口转发到9999端口。
删除转发端口。
查看所有放开的端口。
查看firewalld防火墙状态
重启firewalld防火墙

[root@localhost ~]# firewall-cmd --zone=public --permanent --add-port=3306/tcp 
[root@localhost ~]# firewall-cmd --zone=public --permanent --remove-port=9999/tcp
[root@localhost ~]# firewall-cmd --zone=public --permanent --add-forward-port=port=80:proto=tcp:toport=9999
[root@localhost ~]# firewall-cmd --zone=public --permanent --remove-forward-port=port=80:proto=tcp:toport=9999

[root@localhost ~]# firewall-cmd --list-ports
[root@localhost ~]# systemctl status firewalld
[root@localhost ~]# systemctl restart firewalld

需重启 firewalld

查看路由表 route -n

[root@localhost ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.109.2   0.0.0.0         UG    100    0        0 ens33
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
192.168.109.0   0.0.0.0         255.255.255.0   U     100    0        0 ens33

netstat

[root@localhost ~]# netstat --help
-l, --listening display listening server sockets
-n, --numeric don’t resolve names
-p, --programs display PID/Program name for sockets
-s, --statistics display networking statistics (like SNMP)
={-t|–tcp} {-u|–udp}

查看所有监听端口 netstat -lntp

[root@localhost ~]# netstat -lntp
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:22              0.0.0.0:*               LISTEN      7159/sshd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      7394/master
tcp6       0      0 :::3306                 :::*                    LISTEN      17664/docker-proxy-
tcp6       0      0 :::22                   :::*                    LISTEN      7159/sshd
tcp6       0      0 ::1:25                  :::*                    LISTEN      7394/master

查看所有已经建立的连接 netstat -antp

[root@localhost ~]# netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      7159/sshd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      7394/master
tcp        0      0 192.168.109.33:22       192.168.109.1:59242     ESTABLISHED 18344/sshd: root@pt
tcp        0      0 192.168.109.33:22       192.168.109.1:55208     ESTABLISHED 18128/sshd: root@no

查找pid相关的端口
下面是查找和java程序(pid=4575)相关的端口
java程序维持了3306(mysql)的连接4个
java程序维持了8848 (nacos)的连接2个

[root@DEV-YWZTV1-SE02 ~]# netstat -antp | grep 4575
tcp6       0      0 :::10004                :::*                    LISTEN      4575/java
tcp6       0      0 172.26.238.75:46505     172.26.239.33:3306      ESTABLISHED 4575/java
tcp6       0      0 172.26.238.75:43351     172.26.238.74:8848      ESTABLISHED 4575/java
tcp6       0      0 172.26.238.75:42789     172.26.238.74:8848      ESTABLISHED 4575/java
tcp6       0      0 172.26.238.75:46519     172.26.239.33:3306      ESTABLISHED 4575/java
tcp6       0      0 172.26.238.75:46526     172.26.239.33:3306      ESTABLISHED 4575/java
tcp6       0      0 172.26.238.75:46163     172.26.239.33:3306      ESTABLISHED 4575/java

查看网络统计信息 netstat -s

[root@localhost ~]# netstat -s
Ip:
    60270 total packets received
    47563 forwarded
    0 incoming packets discarded
    12292 incoming packets delivered
    59745 requests sent out
Icmp:
    1 ICMP messages received
    0 input ICMP message failed.
    ICMP input histogram:
        destination unreachable: 1
    2 ICMP messages sent
    0 ICMP messages failed
    ICMP output histogram:
        destination unreachable: 2
IcmpMsg:
        InType3: 1
        OutType3: 2
Tcp:
    26 active connections openings
    4 passive connection openings
    0 failed connection attempts
    0 connection resets received
    2 connections established
    12210 segments received
    31695 segments send out
    3 segments retransmited
    0 bad segments received.
    0 resets sent
Udp:
    79 packets received
    2 packets to unknown port received.
    0 packet receive errors
    81 packets sent
    0 receive buffer errors
    0 send buffer errors

查看进程 ps

Basic options:
 -A, -e               all processes                          显示所有进程信息
 -a                   all with tty, except session leaders   显示所有TTY值存在的进程,除去bash和TTY终端等进程
  a                   all with tty, including other users    显示所有TTY值存在的进程,包括其他用户的
 -d                   all except session leaders             所有进程除去bash或TTY等
  x                   processes without controlling ttys
Selection by list:
 -u, U, --user <UID>  effective user id or name
Output formats:
 -f                   full-format, including command lines
  f, --forest         ascii art process tree
  u                   user-oriented format
  X                   register format
命令描述
ps f用ASCII字符显示树状结构,表达程序间的相互关系。
ps u以用户为主的格式来显示程序状况。
ps -H显示树状结构,表示程序间的相互关系。

查看所有进程 ps -ef

ps -ef 是用标准的格式显示进程的、其格式如下

uidpidppidcSTIMETTYTIMECMD
用户id这个程序的 ID上级父程序的IDCPU使用的资源百分比系统启动时间登入者的终端机位置使用掉的CPU时间所下达的是什么指令
[root@localhost ~]# ps -ef
UID         PID   PPID  C STIME TTY          TIME CMD
root          1      0  0 9月04 ?       00:00:03 /usr/lib/systemd/systemd --switched-root --system --deserialize 22
root          2      0  0 9月04 ?       00:00:00 [kthreadd]
root          3      2  0 9月04 ?       00:00:02 [ksoftirqd/0]

查看所有进程 ps aux

ps aux 是用BSD的格式来显示、其格式如下

USER%CPU%MEMVSZRSSSTATSTARTTIMECOMMAND
用户名进程占用的CPU百分比占用内存的百分比该进程使用的虚拟內存量(KB)该进程占用的固定內存量(KB)(驻留中页的数量)进程的状态该进程被触发启动时间该进程实际使用CPU运行的时间命令的名称和参数
[root@DEV-YWZTV1-SE01 ~]# ps aux
USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root          1  0.0  0.0  44908  7436 ?        Ss   8月09   0:38 /usr/lib/systemd/systemd --switched-root --system --deserialize 21
root          2  0.0  0.0      0     0 ?        S    8月09   0:00 [kthreadd]
root          3  0.0  0.0      0     0 ?        S    8月09   0:01 [ksoftirqd/0]

实时显示进程状态 top

top - 00:12:14 up  7:35,  2 users,  load average: 0.19, 0.19, 0.16
Tasks: 150 total,   1 running, 149 sleeping,   0 stopped,   0 zombie
%Cpu(s):  2.0 us,  1.0 sy,  0.0 ni, 92.3 id,  4.7 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  1863224 `total`,    72620 `free`,  1066292 used,   724312 buff/cache
KiB Swap:  2097148 total,  1453308 free,   643840 used.   194168 avail Mem

   PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND
 10569 200       20   0 3472052 717020   5808 S  2.0 38.5   7:03.37 java
 18731 root      20   0  162016   2028   1316 S  0.7  0.1   0:27.74 top
  3141 root      20   0   38956   4160   3988 S  0.3  0.2   2:15.14 systemd-journal
     1 root      20   0  128024   4344   2460 S  0.0  0.2   0:03.27 systemd
     2 root      20   0       0      0      0 S  0.0  0.0   0:00.01 kthreadd
     3 root      20   0       0      0      0 S  0.0  0.0   0:02.21 ksoftirqd/0
   ...  
   702 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 ata_sff

查看系统安装程序

查看所有安装的软件包 rpm -qa

远程拷贝

[root@localhost ~]# scp /home/tomcat/tomcat28080.tar.gz tomcat@11.8.127.198:/home/tomcat
tomcat@11.8.127.198's password:
tomcat28080.tar.gz                            100%   43MB  72.5MB/s   00:00

把本地文件:/home/tomcat/tomcat28080.tar.gz
拷贝到远程服务器:tomcat@11.8.127.198
登录用户是tomcat,需要输入tomcat用户的密码

软连接

# ln [参数][源文件或目录][目标文件或目录]
# -s [symbolic 代号]
[root@localhost ~]# ln -s /usr/local/a.txt /root/a.txt
[root@localhost ~]# ll /root/a.txt
lrwxrwxrwx 1 root root 16 89 15:14 /root/a.txt -> /usr/local/a.txt
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

qq_26264237

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值