|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
系统安全相关命令:passwd、su、umask、chgrp、chmod、chown、chattr、sudo、pswho
在第一部分文章中我们会商了那些都只是切换到Linux和linux老手所需的需要常识的用户的命令。
对Linux老手十分有效的20个命令
第二篇文章中我们会商了中级用户办理本人的体系所必要的命令。
对中级Linux用户十分有效的20个命令
接上去呢?在这篇文章中我将注释办理Linux服务器所需的一些命令。
41.命令:ifconfig
ifconfig用来设置常驻内核的收集接口信息。在体系启动需要时用来设置收集适配器的信息。以后,它一般是只必要在调试时或当体系必要调剂时利用。
反省举动收集适配器
- [avishek@tecmint~]$ifconfigeth0Linkencap:EthernetHWaddr40:2C:F4:EA:CF:0Einetaddr:192.168.1.3Bcast:192.168.1.255Mask:255.255.255.0inet6addr:fe80::422c:f4ff:feea:cf0e/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:163843errors:0dropped:0overruns:0frame:0TXpackets:124990errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000RXbytes:154389832(147.2MiB)TXbytes:65085817(62.0MiB)Interrupt:20Memory:f7100000-f7120000loLinkencap:LocalLoopbackinetaddr:127.0.0.1Mask:255.0.0.0inet6addr:::1/128Scope:HostUPLOOPBACKRUNNINGMTU:16436Metric:1RXpackets:78errors:0dropped:0overruns:0frame:0TXpackets:78errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:4186(4.0KiB)TXbytes:4186(4.0KiB)
复制代码 反省一切的收集适配器
“-a”参数用来显现一切收集适配器(网卡)的具体信息,包含那些停用的适配器。- [avishek@tecmint~]$ifconfig-aeth0Linkencap:EthernetHWaddr40:2C:F4:EA:CF:0Einetaddr:192.168.1.3Bcast:192.168.1.255Mask:255.255.255.0inet6addr:fe80::422c:f4ff:feea:cf0e/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:163843errors:0dropped:0overruns:0frame:0TXpackets:124990errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000RXbytes:154389832(147.2MiB)TXbytes:65085817(62.0MiB)Interrupt:20Memory:f7100000-f7120000loLinkencap:LocalLoopbackinetaddr:127.0.0.1Mask:255.0.0.0inet6addr:::1/128Scope:HostUPLOOPBACKRUNNINGMTU:16436Metric:1RXpackets:78errors:0dropped:0overruns:0frame:0TXpackets:78errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:4186(4.0KiB)TXbytes:4186(4.0KiB)virbr0Linkencap:EthernetHWaddr0e:30:a3:3a:bf:03inetaddr:192.168.122.1Bcast:192.168.122.255Mask:255.255.255.0UPBROADCASTMULTICASTMTU:1500Metric:1RXpackets:0errors:0dropped:0overruns:0frame:0TXpackets:0errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:0(0.0B)TXbytes:0(0.0B)
复制代码 停用收集适配器
- [avishek@tecmint~]$ifconfigeth0down
复制代码 启用收集适配器
- [avishek@tecmint~]$ifconfigeth0up
复制代码 指定IP地点到收集适配器
为收集适配器eth0设定IP地点“192.168.1.12”.- [avishek@tecmint~]$ifconfigeth0192.168.1.12
复制代码 变动收集适配器eth0的子网掩码
- [avishek@tecmint~]$ifconfigeth0netmask255.255.255.
复制代码 变动收集适配器eth0的播送地点
- [avishek@tecmint~]$ifconfigeth0broadcast192.168.1.255
复制代码 为收集适配器eth0指定IP地点,子网掩码,播送地点
- [avishek@tecmint~]$ifconfigeth0192.168.1.12netmask255.255.255.0broadcast192.168.1.255
复制代码 注Note:假如你设置一块无线网卡的信息,你可使用的命令是“iwconfig”.欲知更多ifconfig命令的例子和利用办法,读“15个有效的ifconfig命令”.
42.命令:netstat
netstat命令显现各类收集相干的信息,如收集毗连,路由表,接口统计,假装毗连,组播成员身份等....
列出一切的收集端口
- [avishek@tecmint~]$netstat-aActiveUNIXdomainsockets(serversandestablished)ProtoRefCntFlagsTypeStateI-NodePathunix2[ACC]STREAMLISTENING741379/run/user/user1/keyring-I5cn1c/gpgunix2[ACC]STREAMLISTENING8965/var/run/acpid.socketunix2[ACC]STREAMLISTENING18584/tmp/.X11-unix/X0unix2[ACC]STREAMLISTENING741385/run/user/user1/keyring-I5cn1c/sshunix2[ACC]STREAMLISTENING741387/run/user/user1/keyring-I5cn1c/pkcs11unix2[ACC]STREAMLISTENING20242@/tmp/dbus-ghtTjuPN46unix2[ACC]STREAMLISTENING13332/var/run/samba/winbindd_privileged/pipeunix2[ACC]STREAMLISTENING13331/tmp/.winbindd/pipeunix2[ACC]STREAMLISTENING11030/var/run/mysqld/mysqld.sockunix2[ACC]STREAMLISTENING19308/tmp/ssh-qnZadSgJAbqd/agent.3221unix2[ACC]STREAMLISTENING436781/tmp/HotShotsunix2[ACC]STREAMLISTENING46110/run/user/ravisaive/pulse/nativeunix2[ACC]STREAMLISTENING19310/tmp/gpg-zfE9YT/S.gpg-agent....
复制代码 显现一切tcp相干端口
- [avishek@tecmint~]$netstat-atActiveInternetconnections(serversandestablished)ProtoRecv-QSend-QLocalAddressForeignAddressStatetcp00localhost:mysql*:*LISTENtcp00*:5901*:*LISTENtcp00*:5902*:*LISTENtcp00*:x11-1*:*LISTENtcp00*:x11-2*:*LISTENtcp00*:5938*:*LISTENtcp00localhost:5940*:*LISTENtcp00ravisaive-OptiPl:domain*:*LISTENtcp00ravisaive-OptiPl:domain*:*LISTENtcp00localhost:ipp*:*LISTENtcp00ravisaive-OptiPle:48270ec2-23-21-236-70.c:httpESTABLISHEDtcp00ravisaive-OptiPle:48272ec2-23-21-236-70.c:httpTIME_WAITtcp00ravisaive-OptiPle:48421bom03s01-in-f22.1:httpsESTABLISHEDtcp00ravisaive-OptiPle:48269ec2-23-21-236-70.c:httpESTABLISHEDtcp00ravisaive-OptiPle:39084channel-ecmp-06-f:httpsESTABLISHED...
复制代码 显现一切毗连的统计信息
- [avishek@tecmint~]$ifconfig-aeth0Linkencap:EthernetHWaddr40:2C:F4:EA:CF:0Einetaddr:192.168.1.3Bcast:192.168.1.255Mask:255.255.255.0inet6addr:fe80::422c:f4ff:feea:cf0e/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:163843errors:0dropped:0overruns:0frame:0TXpackets:124990errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000RXbytes:154389832(147.2MiB)TXbytes:65085817(62.0MiB)Interrupt:20Memory:f7100000-f7120000loLinkencap:LocalLoopbackinetaddr:127.0.0.1Mask:255.0.0.0inet6addr:::1/128Scope:HostUPLOOPBACKRUNNINGMTU:16436Metric:1RXpackets:78errors:0dropped:0overruns:0frame:0TXpackets:78errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:4186(4.0KiB)TXbytes:4186(4.0KiB)virbr0Linkencap:EthernetHWaddr0e:30:a3:3a:bf:03inetaddr:192.168.122.1Bcast:192.168.122.255Mask:255.255.255.0UPBROADCASTMULTICASTMTU:1500Metric:1RXpackets:0errors:0dropped:0overruns:0frame:0TXpackets:0errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:0(0.0B)TXbytes:0(0.0B)0
复制代码 好的!因为某些缘故原由假如你不想剖析netstat输入的主机、端口和用户称号的话。- [avishek@tecmint~]$ifconfig-aeth0Linkencap:EthernetHWaddr40:2C:F4:EA:CF:0Einetaddr:192.168.1.3Bcast:192.168.1.255Mask:255.255.255.0inet6addr:fe80::422c:f4ff:feea:cf0e/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:163843errors:0dropped:0overruns:0frame:0TXpackets:124990errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000RXbytes:154389832(147.2MiB)TXbytes:65085817(62.0MiB)Interrupt:20Memory:f7100000-f7120000loLinkencap:LocalLoopbackinetaddr:127.0.0.1Mask:255.0.0.0inet6addr:::1/128Scope:HostUPLOOPBACKRUNNINGMTU:16436Metric:1RXpackets:78errors:0dropped:0overruns:0frame:0TXpackets:78errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:4186(4.0KiB)TXbytes:4186(4.0KiB)virbr0Linkencap:EthernetHWaddr0e:30:a3:3a:bf:03inetaddr:192.168.122.1Bcast:192.168.122.255Mask:255.255.255.0UPBROADCASTMULTICASTMTU:1500Metric:1RXpackets:0errors:0dropped:0overruns:0frame:0TXpackets:0errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:0(0.0B)TXbytes:0(0.0B)1
复制代码 好,你大概必要猎取的netstat延续输入的静态信息,经由过程传送中止输入指令(ctrl+c)来中断。- [avishek@tecmint~]$ifconfig-aeth0Linkencap:EthernetHWaddr40:2C:F4:EA:CF:0Einetaddr:192.168.1.3Bcast:192.168.1.255Mask:255.255.255.0inet6addr:fe80::422c:f4ff:feea:cf0e/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:163843errors:0dropped:0overruns:0frame:0TXpackets:124990errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000RXbytes:154389832(147.2MiB)TXbytes:65085817(62.0MiB)Interrupt:20Memory:f7100000-f7120000loLinkencap:LocalLoopbackinetaddr:127.0.0.1Mask:255.0.0.0inet6addr:::1/128Scope:HostUPLOOPBACKRUNNINGMTU:16436Metric:1RXpackets:78errors:0dropped:0overruns:0frame:0TXpackets:78errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:4186(4.0KiB)TXbytes:4186(4.0KiB)virbr0Linkencap:EthernetHWaddr0e:30:a3:3a:bf:03inetaddr:192.168.122.1Bcast:192.168.122.255Mask:255.255.255.0UPBROADCASTMULTICASTMTU:1500Metric:1RXpackets:0errors:0dropped:0overruns:0frame:0TXpackets:0errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:0(0.0B)TXbytes:0(0.0B)2
复制代码 更多关于“netstat”的例子和利用办法,扫瞄文章“20个netstat的利用案例”。
43.命令:nslookup
收集有用程序,用于取得互联网服务器的信息。望文生义,该有用程序将发明经由过程查询DNS域的称号服务器信息。- [avishek@tecmint~]$ifconfig-aeth0Linkencap:EthernetHWaddr40:2C:F4:EA:CF:0Einetaddr:192.168.1.3Bcast:192.168.1.255Mask:255.255.255.0inet6addr:fe80::422c:f4ff:feea:cf0e/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:163843errors:0dropped:0overruns:0frame:0TXpackets:124990errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000RXbytes:154389832(147.2MiB)TXbytes:65085817(62.0MiB)Interrupt:20Memory:f7100000-f7120000loLinkencap:LocalLoopbackinetaddr:127.0.0.1Mask:255.0.0.0inet6addr:::1/128Scope:HostUPLOOPBACKRUNNINGMTU:16436Metric:1RXpackets:78errors:0dropped:0overruns:0frame:0TXpackets:78errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:4186(4.0KiB)TXbytes:4186(4.0KiB)virbr0Linkencap:EthernetHWaddr0e:30:a3:3a:bf:03inetaddr:192.168.122.1Bcast:192.168.122.255Mask:255.255.255.0UPBROADCASTMULTICASTMTU:1500Metric:1RXpackets:0errors:0dropped:0overruns:0frame:0TXpackets:0errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:0(0.0B)TXbytes:0(0.0B)3
复制代码 查询邮件互换器纪录
- [avishek@tecmint~]$ifconfig-aeth0Linkencap:EthernetHWaddr40:2C:F4:EA:CF:0Einetaddr:192.168.1.3Bcast:192.168.1.255Mask:255.255.255.0inet6addr:fe80::422c:f4ff:feea:cf0e/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:163843errors:0dropped:0overruns:0frame:0TXpackets:124990errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000RXbytes:154389832(147.2MiB)TXbytes:65085817(62.0MiB)Interrupt:20Memory:f7100000-f7120000loLinkencap:LocalLoopbackinetaddr:127.0.0.1Mask:255.0.0.0inet6addr:::1/128Scope:HostUPLOOPBACKRUNNINGMTU:16436Metric:1RXpackets:78errors:0dropped:0overruns:0frame:0TXpackets:78errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:4186(4.0KiB)TXbytes:4186(4.0KiB)virbr0Linkencap:EthernetHWaddr0e:30:a3:3a:bf:03inetaddr:192.168.122.1Bcast:192.168.122.255Mask:255.255.255.0UPBROADCASTMULTICASTMTU:1500Metric:1RXpackets:0errors:0dropped:0overruns:0frame:0TXpackets:0errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:0(0.0B)TXbytes:0(0.0B)4
复制代码 查询域名服务器
- [avishek@tecmint~]$ifconfig-aeth0Linkencap:EthernetHWaddr40:2C:F4:EA:CF:0Einetaddr:192.168.1.3Bcast:192.168.1.255Mask:255.255.255.0inet6addr:fe80::422c:f4ff:feea:cf0e/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:163843errors:0dropped:0overruns:0frame:0TXpackets:124990errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000RXbytes:154389832(147.2MiB)TXbytes:65085817(62.0MiB)Interrupt:20Memory:f7100000-f7120000loLinkencap:LocalLoopbackinetaddr:127.0.0.1Mask:255.0.0.0inet6addr:::1/128Scope:HostUPLOOPBACKRUNNINGMTU:16436Metric:1RXpackets:78errors:0dropped:0overruns:0frame:0TXpackets:78errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:4186(4.0KiB)TXbytes:4186(4.0KiB)virbr0Linkencap:EthernetHWaddr0e:30:a3:3a:bf:03inetaddr:192.168.122.1Bcast:192.168.122.255Mask:255.255.255.0UPBROADCASTMULTICASTMTU:1500Metric:1RXpackets:0errors:0dropped:0overruns:0frame:0TXpackets:0errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:0(0.0B)TXbytes:0(0.0B)5
复制代码 查询DNS纪录
- [avishek@tecmint~]$ifconfig-aeth0Linkencap:EthernetHWaddr40:2C:F4:EA:CF:0Einetaddr:192.168.1.3Bcast:192.168.1.255Mask:255.255.255.0inet6addr:fe80::422c:f4ff:feea:cf0e/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:163843errors:0dropped:0overruns:0frame:0TXpackets:124990errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000RXbytes:154389832(147.2MiB)TXbytes:65085817(62.0MiB)Interrupt:20Memory:f7100000-f7120000loLinkencap:LocalLoopbackinetaddr:127.0.0.1Mask:255.0.0.0inet6addr:::1/128Scope:HostUPLOOPBACKRUNNINGMTU:16436Metric:1RXpackets:78errors:0dropped:0overruns:0frame:0TXpackets:78errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:4186(4.0KiB)TXbytes:4186(4.0KiB)virbr0Linkencap:EthernetHWaddr0e:30:a3:3a:bf:03inetaddr:192.168.122.1Bcast:192.168.122.255Mask:255.255.255.0UPBROADCASTMULTICASTMTU:1500Metric:1RXpackets:0errors:0dropped:0overruns:0frame:0TXpackets:0errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:0(0.0B)TXbytes:0(0.0B)6
复制代码 查询肇端受权机构
- [avishek@tecmint~]$ifconfig-aeth0Linkencap:EthernetHWaddr40:2C:F4:EA:CF:0Einetaddr:192.168.1.3Bcast:192.168.1.255Mask:255.255.255.0inet6addr:fe80::422c:f4ff:feea:cf0e/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:163843errors:0dropped:0overruns:0frame:0TXpackets:124990errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000RXbytes:154389832(147.2MiB)TXbytes:65085817(62.0MiB)Interrupt:20Memory:f7100000-f7120000loLinkencap:LocalLoopbackinetaddr:127.0.0.1Mask:255.0.0.0inet6addr:::1/128Scope:HostUPLOOPBACKRUNNINGMTU:16436Metric:1RXpackets:78errors:0dropped:0overruns:0frame:0TXpackets:78errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:4186(4.0KiB)TXbytes:4186(4.0KiB)virbr0Linkencap:EthernetHWaddr0e:30:a3:3a:bf:03inetaddr:192.168.122.1Bcast:192.168.122.255Mask:255.255.255.0UPBROADCASTMULTICASTMTU:1500Metric:1RXpackets:0errors:0dropped:0overruns:0frame:0TXpackets:0errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:0(0.0B)TXbytes:0(0.0B)7
复制代码 查询端标语
变动利用你想要毗连的端标语- [avishek@tecmint~]$ifconfig-aeth0Linkencap:EthernetHWaddr40:2C:F4:EA:CF:0Einetaddr:192.168.1.3Bcast:192.168.1.255Mask:255.255.255.0inet6addr:fe80::422c:f4ff:feea:cf0e/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:163843errors:0dropped:0overruns:0frame:0TXpackets:124990errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000RXbytes:154389832(147.2MiB)TXbytes:65085817(62.0MiB)Interrupt:20Memory:f7100000-f7120000loLinkencap:LocalLoopbackinetaddr:127.0.0.1Mask:255.0.0.0inet6addr:::1/128Scope:HostUPLOOPBACKRUNNINGMTU:16436Metric:1RXpackets:78errors:0dropped:0overruns:0frame:0TXpackets:78errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:4186(4.0KiB)TXbytes:4186(4.0KiB)virbr0Linkencap:EthernetHWaddr0e:30:a3:3a:bf:03inetaddr:192.168.122.1Bcast:192.168.122.255Mask:255.255.255.0UPBROADCASTMULTICASTMTU:1500Metric:1RXpackets:0errors:0dropped:0overruns:0frame:0TXpackets:0errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:0(0.0B)TXbytes:0(0.0B)8
复制代码 更多浏览8个Nslookup命令
44.命令:dig
dig是查询DNS域名服务器的工具,能够查询的主机地点、邮件交换、域名服务器相干的信息。在任何Linux(Unix)或MacintoshOSX操纵体系上,都可使用该工具。dig的最典范的用法是单个主机的查询。- [avishek@tecmint~]$ifconfig-aeth0Linkencap:EthernetHWaddr40:2C:F4:EA:CF:0Einetaddr:192.168.1.3Bcast:192.168.1.255Mask:255.255.255.0inet6addr:fe80::422c:f4ff:feea:cf0e/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:163843errors:0dropped:0overruns:0frame:0TXpackets:124990errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000RXbytes:154389832(147.2MiB)TXbytes:65085817(62.0MiB)Interrupt:20Memory:f7100000-f7120000loLinkencap:LocalLoopbackinetaddr:127.0.0.1Mask:255.0.0.0inet6addr:::1/128Scope:HostUPLOOPBACKRUNNINGMTU:16436Metric:1RXpackets:78errors:0dropped:0overruns:0frame:0TXpackets:78errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:4186(4.0KiB)TXbytes:4186(4.0KiB)virbr0Linkencap:EthernetHWaddr0e:30:a3:3a:bf:03inetaddr:192.168.122.1Bcast:192.168.122.255Mask:255.255.255.0UPBROADCASTMULTICASTMTU:1500Metric:1RXpackets:0errors:0dropped:0overruns:0frame:0TXpackets:0errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:0(0.0B)TXbytes:0(0.0B)9
复制代码 封闭正文行
- [avishek@tecmint~]$ifconfigeth0down0
复制代码 封闭认证块
- [avishek@tecmint~]$ifconfigeth0down1
复制代码 封闭其他块
- [avishek@tecmint~]$ifconfigeth0down2
复制代码 封闭统计块
- [avishek@tecmint~]$ifconfigeth0down3
复制代码 封闭复兴块
- [avishek@tecmint~]$ifconfigeth0down4
复制代码 封闭一切块
- [avishek@tecmint~]$ifconfigeth0down5
复制代码 浏览更多10个LinuxDig命令实例
45.命令:uptime
你毗连到你的Linux服务器时发明一些不平常或歹意的器材,你会做甚么?推测......不,毫不!你能够运转uptime来考证当服务器无人值守式究竟产生了甚么事变。- [avishek@tecmint~]$ifconfigeth0down6
复制代码 46.命令:wall
对体系办理员来讲一个最主要的命令.wall发送一条动静到人人登录端将其mesg权限设置为"yes"。这条信息能够被wall作为参数,大概能够将它作为wall的尺度输出。- [avishek@tecmint~]$ifconfigeth0down7
复制代码 47.命令:mesg
其别人们可使用"wtrite"命令,将在在向您发送文本到屏幕上。你能够把持是不是显现。- [avishek@tecmint~]$ifconfigeth0down8
复制代码 48.命令:write
假如mesg是y,让你的文本间接发送到另外一台Linux呆板的屏幕。.- [avishek@tecmint~]$ifconfigeth0down9
复制代码 49.命令:talk
加强的write命令,talk命令可以让你与其他登录的用户扳谈。- [avishek@tecmint~]$ifconfigeth0up0
复制代码 正文:假如talk命令没安装的话,能够经由过程apt或yum安装所需的包.- [avishek@tecmint~]$ifconfigeth0up1
复制代码 50.命令:w
是不是以为命令w很幽默?可是现实上不是的。它是一个命令,只管只要一个字符长!命令"w"是uptime和who命令,之前后的按次组合在一同。- [avishek@tecmint~]$ifconfigeth0up2
复制代码 51.命令:rename
见名知意,这个命令重定名文件。rename将会经由过程从文件名的首字符入手下手交换,重定名为指定的文件名。- [avishek@tecmint~]$ifconfigeth0up3
复制代码 仅仅写这些命令:[@Lesus注:在Ubuntu上不撑持这类格局,rename与mv分歧的是,rename能够批量修正,好像带了while的mv操纵。]- [avishek@tecmint~]$ifconfigeth0up4
复制代码 52.命令:top
显现CPU历程信息。这个命令主动革新,默许是延续显现CPU历程信息,除非利用了中止指令。- [avishek@tecmint~]$ifconfigeth0up5
复制代码 另检察12TOP命令例子·[@Lesus注:htop比top命令更好用,不外必要本人安装
53.命令:mkfs.ext4
这个命令在指定的设备上创立一个新的ext4文件体系,假如这个命令前面跟的是个毛病的设备,那末全部设备就会被擦除和格局化,以是倡议不要运转这个命令,除非你分明本人正在干甚么。- [avishek@tecmint~]$ifconfigeth0up6
复制代码 更多检察:Ext4是甚么及怎样创立和转换
54.vi/emac/nano命令
vi(visual),emac,nano是linux中最经常使用的一些编纂器。它们常常用于编纂文本,设置,…等文件.Aquickguidetoworkaroundviandnanois,emacisa.
vi编纂器:
- [avishek@tecmint~]$ifconfigeth0up7
复制代码 [按下‘i’键进进拔出形式,不然你不克不及输出任何内容]- [avishek@tecmint~]$ifconfigeth0up8
复制代码
- alt+x(加入拔出形式,记得在最初的字符间留有一些空格.
- ctrl+x命令或你上一个单词将被删除).
- :wq!(以以后的文本保留文件,记着‘!’是掩盖的意义).
nano编纂器:
- [avishek@tecmint~]$ifconfigeth0up9
复制代码- [avishek@tecmint~]$ifconfigeth0192.168.1.120
复制代码 ctrl+x(封闭编纂器).它会显现以下的提醒输入信息:- [avishek@tecmint~]$ifconfigeth0192.168.1.121
复制代码 点击‘y’选择yes并输出文件名,就完成编纂了.
55.命令:rsync
Rsync复制文件,参数-P开启进度条。假如你已安装了rsync,你可使用一个复杂的别号。- [avishek@tecmint~]$ifconfigeth0192.168.1.122
复制代码 如今实验在终端复制一个年夜文件,如许将会看到显现残剩部分的输入,与进度条相似。
并且,坚持和保护备份是体系办理员不能不做的最主要、最无聊的事情之一。Rsync是一个用于新建和保护备份的十分好用的终端工具(也存在很多别的工具)。- [avishek@tecmint~]$ifconfigeth0192.168.1.123
复制代码 注重:-z暗示紧缩,-v暗示具体信息,-r暗示递回。
56.命令:free
跟踪内存的利用和资本一样主要,就像办理员实行的任何别的义务,可使用free命令来在这里救济.
以后内存利用形态CurrentUsageStatusofMemory
- [avishek@tecmint~]$ifconfigeth0192.168.1.124
复制代码 设置输入单元为KB,MB或GB
- [avishek@tecmint~]$ifconfigeth0192.168.1.125
复制代码- [avishek@tecmint~]$ifconfigeth0192.168.1.126
复制代码- [avishek@tecmint~]$ifconfigeth0192.168.1.127
复制代码- [avishek@tecmint~]$ifconfigeth0192.168.1.128
复制代码 以可读的格局显现,反省以后内存利用
- [avishek@tecmint~]$ifconfigeth0192.168.1.129
复制代码 设定工夫距离后,延续反省利用形态
- [avishek@tecmint~]$ifconfigeth0netmask255.255.255.0
复制代码 浏览更多10个Free命令利用实例
57.mysqldump命令
好了,如今你从名字上就可以分明这个命令所代表的感化。mysqldump命令会转储(备份)数据库的全体或特定一部分数据到一个给定的文件中。比方:- [avishek@tecmint~]$ifconfigeth0netmask255.255.255.1
复制代码 注重:mysqldump必要mysql在运转中而且有准确的受权暗码。我们在用mysqldump命令备份数据库中会商了一些有效的“mysqldump”命令用法。
58.mkpasswd命令
依据指定的长度,发生一个难猜的随秘密码。- [avishek@tecmint~]$ifconfigeth0netmask255.255.255.2
复制代码- [avishek@tecmint~]$ifconfigeth0netmask255.255.255.3
复制代码 注重:-l10发生一个10个字符的随秘密码,而-l20发生20个字符的暗码,它能够设置为恣意长度来获得所但愿的了局。这个命令很有效,常常在剧本言语里利用来发生随机的暗码。你大概必要yum或apt‘expect’包来利用这个命令。- [avishek@tecmint~]$ifconfigeth0netmask255.255.255.4
复制代码 59.Command:paste
兼并两个或多个文本文件,按行来举行兼并。示例。假如file1的内容是:- [avishek@tecmint~]$ifconfigeth0netmask255.255.255.5
复制代码- [avishek@tecmint~]$ifconfigeth0netmask255.255.255.6
复制代码 了局file3将是:1a2b3cd
60.Command:lsof
lsof是"listopenfiles("列表中翻开的文件")的缩写,显现您的体系以后已翻开的一切文件。这长短常有效的关于想找出哪些历程利用某一特定文件,或显现为单个历程翻开一切文件。一些有效的10个lsof命令示例,你大概会感乐趣浏览。- [avishek@tecmint~]$ifconfigeth0netmask255.255.255.7
复制代码 这里并没有停止,体系办理员会良多器材,为你供应大度的界面,服务于你的事情。体系办理实践上是进修和完成的一门文雅的艺术。我们会全力给你先容linux专业职员必需懂得的常识和一些其他需要器材,linux自己是基本的,复杂的。深切了解是不休进修的历程。你的美言好词老是在不休勉励我们写出更多的优异,丰厚的文章。"喜之以分享,助我来传布"。
英文http://www.tecmint.com/20-advanced-commands-for-linux-experts/
初学阶段只要把上课时候学习过的命令练熟就可以了.单靠学习各种命令而成为高手是不可能的。 |
|