查看端口

netstat -an

 

[root@ftp /]# netstat -anp|grep java
tcp        0      0 0.0.0.0:8266                0.0.0.0:*                   LISTEN      11962/java         
tcp        0      0 :::8002                     :::*                        LISTEN      11962/java         
tcp        0      0 :::8066                     :::*                        LISTEN      11962/java         
tcp        0      0 ::ffff:127.0.0.1:8003       :::*                        LISTEN      20436/java         
tcp        0      0 ::ffff:127.0.0.1:8005       :::*                        LISTEN      18515/java         
tcp        0      0 ::ffff:127.0.0.1:8103       :::*                        LISTEN      11962/java         
tcp        0      0 :::8009                     :::*                        LISTEN      18515/java         
tcp        0      0 :::8011                     :::*                        LISTEN      20436/java         
tcp        0      0 :::10000                    :::*                        LISTEN      11962/java         
tcp        0      0 :::8086                     :::*                        LISTEN      20436/java         
tcp        0      0 :::8888                     :::*                        LISTEN      18515/java         
tcp        0      0 ::ffff:127.0.0.1:58419      ::ffff:127.0.0.1:3306       ESTABLISHED 18515/java         
tcp        0      0 ::ffff:000.000000000 :44186 ::ffff:172.16.0.37:57788    ESTABLISHED 11962/java         
tcp        0      0 ::ffff:  000.000000000   :50398 ::ffff: 000.000000000 :3306  ESTABLISHED 11962/java         
tcp        0      0 ::ffff: 000.000000000 :51171 ::ffff:172.16.0.43:39673    ESTABLISHED 11962/java         
tcp        0      0 ::ffff: 000.000000000 :47978 ::ffff: 000.000000000 :3306  ESTABLISHED 11962/java         
tcp        0      0 ::ffff:127.0.0.1:48738      ::ffff:127.0.0.1:3306       ESTABLISHED 18515/java         
tcp        0      0 ::ffff:127.0.0.1:45878      ::ffff:127.0.0.1:3306       ESTABLISHED 18515/java         
tcp        0      0 ::ffff:127.0.0.1:39391      ::ffff:127.0.0.1:3306       ESTABLISHED 20436/java         
tcp        0      0 ::ffff:127.0.0.1:40047      ::ffff:127.0.0.1:3306       ESTABLISHED 20436/java         
tcp        0      0 ::ffff: 000.000000000 :56304 ::ffff:172.16.0.37:57788    ESTABLISHED 11962/java         
tcp        0      0 ::ffff:127.0.0.1:37961      ::ffff:127.0.0.1:3306       ESTABLISHED 18515/java         
tcp        0      0 ::ffff: 000.000000000 :52309 ::ffff:172.16.0.30:52031    ESTABLISHED 11962/java         
unix  2      [ ]         STREAM     CONNECTED     3177246 20436/java         
unix  2      [ ]         STREAM     CONNECTED     3155186 18515/java         
unix  2      [ ]         DGRAM                    3155175 18515/java         
unix  2      [ ]         DGRAM                    3061808 11962/java         

000.0000000为公网ip,(安全起见)

查看端口属于哪个程序?端口被哪个进程占用

lsof -i : 8086

[root@ftp bin]# lsof -i:8086
COMMAND   PID USER   FD   TYPE  DEVICE SIZE NODE NAME
java    20436 root    5u  IPv6 3177054       TCP *:8086 (LISTEN)


查看磁盘空间

[root@localhost ~]# df -h

文件系统 容量 已用 可用 已用% 挂载点

/dev/sda3              19G  6.4G   12G  36% /
/dev/sda2              95G   28G   63G  31% /home
/dev/sda1              99M   12M   83M  12% /boot
tmpfs                 2.0G     0  2.0G   0% /dev/shm

查看具体文件目录空间信息

[root@localhost ~]#du --max-depth=1 -h

[root@ftp /]# pwd
/
[root@ftp /]# du --max-depth=1 -h
66M     ./public
3.7G    ./usr
61M     ./etc
5.6M    ./boot
100K    ./tftpboot
2.1M    ./root
0       ./misc
8.0K    ./srv
8.0K    ./scripts
116K    ./tmp
44K     ./logs
0       ./proc
0       ./sys
16K     ./lost+found
8.0K    ./selinux
2.9G    ./mnt
26G     ./home
248M    ./var
32M     ./sbin
0       ./net
88K     ./dev
8.0K    ./opt
35M     ./back
8.0K    ./media
7.2M    ./bin
79M     ./lib
33G     .

 

linux对linux 远程拷贝   scp命令

scp 文件名  root@远程ip:/路径/

将本地home目录下的test.tar的文件拷贝到远程主机192.168.1.23的/home/adm/目录下,则命令为:scp /home/test.tar root@192.168.1.23:/home/adm/  回车后输入密码就可以了

scp提供了几个选项  在scp后加就行了

    -p 拷贝文件的时候保留源文件建立的时间。
    -q 执行文件拷贝时,不显示任何提示消息。
    -r 拷贝整个目录
    -v 拷贝文件时,显示提示信息。

Logo

更多推荐