若相依 发表于 2015-1-15 22:16:46

Linux教程之对Linux专家十分有效的20个命令

系统安全相关命令:passwd、su、umask、chgrp、chmod、chown、chattr、sudo、pswho
  在第一部分文章中我们会商了那些都只是切换到Linux和linux老手所需的需要常识的用户的命令。
  对Linux老手十分有效的20个命令
  第二篇文章中我们会商了中级用户办理本人的体系所必要的命令。
  对中级Linux用户十分有效的20个命令
  接上去呢?在这篇文章中我将注释办理Linux服务器所需的一些命令。



  41.命令:ifconfig

  ifconfig用来设置常驻内核的收集接口信息。在体系启动需要时用来设置收集适配器的信息。以后,它一般是只必要在调试时或当体系必要调剂时利用。
  反省举动收集适配器

$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”参数用来显现一切收集适配器(网卡)的具体信息,包含那些停用的适配器。
$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)  停用收集适配器

$ifconfigeth0down  启用收集适配器

$ifconfigeth0up  指定IP地点到收集适配器

  为收集适配器eth0设定IP地点“192.168.1.12”.
$ifconfigeth0192.168.1.12  变动收集适配器eth0的子网掩码

$ifconfigeth0netmask255.255.255.  变动收集适配器eth0的播送地点

$ifconfigeth0broadcast192.168.1.255  为收集适配器eth0指定IP地点,子网掩码,播送地点

$ifconfigeth0192.168.1.12netmask255.255.255.0broadcast192.168.1.255  注Note:假如你设置一块无线网卡的信息,你可使用的命令是“iwconfig”.欲知更多ifconfig命令的例子和利用办法,读“15个有效的ifconfig命令”.
  42.命令:netstat

  netstat命令显现各类收集相干的信息,如收集毗连,路由表,接口统计,假装毗连,组播成员身份等....
  列出一切的收集端口

$netstat-aActiveUNIXdomainsockets(serversandestablished)ProtoRefCntFlagsTypeStateI-NodePathunix2STREAMLISTENING741379/run/user/user1/keyring-I5cn1c/gpgunix2STREAMLISTENING8965/var/run/acpid.socketunix2STREAMLISTENING18584/tmp/.X11-unix/X0unix2STREAMLISTENING741385/run/user/user1/keyring-I5cn1c/sshunix2STREAMLISTENING741387/run/user/user1/keyring-I5cn1c/pkcs11unix2STREAMLISTENING20242@/tmp/dbus-ghtTjuPN46unix2STREAMLISTENING13332/var/run/samba/winbindd_privileged/pipeunix2STREAMLISTENING13331/tmp/.winbindd/pipeunix2STREAMLISTENING11030/var/run/mysqld/mysqld.sockunix2STREAMLISTENING19308/tmp/ssh-qnZadSgJAbqd/agent.3221unix2STREAMLISTENING436781/tmp/HotShotsunix2STREAMLISTENING46110/run/user/ravisaive/pulse/nativeunix2STREAMLISTENING19310/tmp/gpg-zfE9YT/S.gpg-agent....  显现一切tcp相干端口

$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...  显现一切毗连的统计信息

$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输入的主机、端口和用户称号的话。
$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)来中断。
$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域的称号服务器信息。
$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  查询邮件互换器纪录

$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  查询域名服务器

$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纪录

$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  查询肇端受权机构

$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  查询端标语

  变动利用你想要毗连的端标语
$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的最典范的用法是单个主机的查询。
$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  封闭正文行

$ifconfigeth0down0  封闭认证块

$ifconfigeth0down1  封闭其他块

$ifconfigeth0down2  封闭统计块

$ifconfigeth0down3  封闭复兴块

$ifconfigeth0down4  封闭一切块

$ifconfigeth0down5  浏览更多10个LinuxDig命令实例
  45.命令:uptime

  你毗连到你的Linux服务器时发明一些不平常或歹意的器材,你会做甚么?推测......不,毫不!你能够运转uptime来考证当服务器无人值守式究竟产生了甚么事变。
$ifconfigeth0down6  46.命令:wall

  对体系办理员来讲一个最主要的命令.wall发送一条动静到人人登录端将其mesg权限设置为"yes"。这条信息能够被wall作为参数,大概能够将它作为wall的尺度输出。
$ifconfigeth0down7  47.命令:mesg

  其别人们可使用"wtrite"命令,将在在向您发送文本到屏幕上。你能够把持是不是显现。
$ifconfigeth0down8  48.命令:write

  假如mesg是y,让你的文本间接发送到另外一台Linux呆板的屏幕。.
$ifconfigeth0down9  49.命令:talk

  加强的write命令,talk命令可以让你与其他登录的用户扳谈。
$ifconfigeth0up0  正文:假如talk命令没安装的话,能够经由过程apt或yum安装所需的包.
$ifconfigeth0up1  50.命令:w

  是不是以为命令w很幽默?可是现实上不是的。它是一个命令,只管只要一个字符长!命令"w"是uptime和who命令,之前后的按次组合在一同。
$ifconfigeth0up2  51.命令:rename

  见名知意,这个命令重定名文件。rename将会经由过程从文件名的首字符入手下手交换,重定名为指定的文件名。
$ifconfigeth0up3  仅仅写这些命令:[@Lesus注:在Ubuntu上不撑持这类格局,rename与mv分歧的是,rename能够批量修正,好像带了while的mv操纵。]
$ifconfigeth0up4  52.命令:top

  显现CPU历程信息。这个命令主动革新,默许是延续显现CPU历程信息,除非利用了中止指令。
$ifconfigeth0up5  另检察12TOP命令例子·[@Lesus注:htop比top命令更好用,不外必要本人安装
  53.命令:mkfs.ext4

  这个命令在指定的设备上创立一个新的ext4文件体系,假如这个命令前面跟的是个毛病的设备,那末全部设备就会被擦除和格局化,以是倡议不要运转这个命令,除非你分明本人正在干甚么。
$ifconfigeth0up6  更多检察:Ext4是甚么及怎样创立和转换
  54.vi/emac/nano命令

  vi(visual),emac,nano是linux中最经常使用的一些编纂器。它们常常用于编纂文本,设置,…等文件.Aquickguidetoworkaroundviandnanois,emacisa.
  vi编纂器:

$ifconfigeth0up7  [按下‘i’键进进拔出形式,不然你不克不及输出任何内容]
$ifconfigeth0up8
[*]alt+x(加入拔出形式,记得在最初的字符间留有一些空格.
[*]ctrl+x命令或你上一个单词将被删除).
[*]:wq!(以以后的文本保留文件,记着‘!’是掩盖的意义).
  nano编纂器:

$ifconfigeth0up9$ifconfigeth0192.168.1.120  ctrl+x(封闭编纂器).它会显现以下的提醒输入信息:
$ifconfigeth0192.168.1.121  点击‘y’选择yes并输出文件名,就完成编纂了.
  55.命令:rsync

  Rsync复制文件,参数-P开启进度条。假如你已安装了rsync,你可使用一个复杂的别号。
$ifconfigeth0192.168.1.122  如今实验在终端复制一个年夜文件,如许将会看到显现残剩部分的输入,与进度条相似。
  并且,坚持和保护备份是体系办理员不能不做的最主要、最无聊的事情之一。Rsync是一个用于新建和保护备份的十分好用的终端工具(也存在很多别的工具)。
$ifconfigeth0192.168.1.123  注重:-z暗示紧缩,-v暗示具体信息,-r暗示递回。
  56.命令:free

  跟踪内存的利用和资本一样主要,就像办理员实行的任何别的义务,可使用free命令来在这里救济.
  以后内存利用形态CurrentUsageStatusofMemory

$ifconfigeth0192.168.1.124  设置输入单元为KB,MB或GB

$ifconfigeth0192.168.1.125$ifconfigeth0192.168.1.126$ifconfigeth0192.168.1.127$ifconfigeth0192.168.1.128  以可读的格局显现,反省以后内存利用

$ifconfigeth0192.168.1.129  设定工夫距离后,延续反省利用形态

$ifconfigeth0netmask255.255.255.0  浏览更多10个Free命令利用实例
  57.mysqldump命令

  好了,如今你从名字上就可以分明这个命令所代表的感化。mysqldump命令会转储(备份)数据库的全体或特定一部分数据到一个给定的文件中。比方:
$ifconfigeth0netmask255.255.255.1  注重:mysqldump必要mysql在运转中而且有准确的受权暗码。我们在用mysqldump命令备份数据库中会商了一些有效的“mysqldump”命令用法。
  58.mkpasswd命令

  依据指定的长度,发生一个难猜的随秘密码。
$ifconfigeth0netmask255.255.255.2$ifconfigeth0netmask255.255.255.3  注重:-l10发生一个10个字符的随秘密码,而-l20发生20个字符的暗码,它能够设置为恣意长度来获得所但愿的了局。这个命令很有效,常常在剧本言语里利用来发生随机的暗码。你大概必要yum或apt‘expect’包来利用这个命令。
$ifconfigeth0netmask255.255.255.4  59.Command:paste

  兼并两个或多个文本文件,按行来举行兼并。示例。假如file1的内容是:
$ifconfigeth0netmask255.255.255.5$ifconfigeth0netmask255.255.255.6
  了局file3将是:1a2b3cd
  60.Command:lsof

  lsof是"listopenfiles("列表中翻开的文件")的缩写,显现您的体系以后已翻开的一切文件。这长短常有效的关于想找出哪些历程利用某一特定文件,或显现为单个历程翻开一切文件。一些有效的10个lsof命令示例,你大概会感乐趣浏览。
$ifconfigeth0netmask255.255.255.7  这里并没有停止,体系办理员会良多器材,为你供应大度的界面,服务于你的事情。体系办理实践上是进修和完成的一门文雅的艺术。我们会全力给你先容linux专业职员必需懂得的常识和一些其他需要器材,linux自己是基本的,复杂的。深切了解是不休进修的历程。你的美言好词老是在不休勉励我们写出更多的优异,丰厚的文章。"喜之以分享,助我来传布"。
  英文http://www.tecmint.com/20-advanced-commands-for-linux-experts/
初学阶段只要把上课时候学习过的命令练熟就可以了.单靠学习各种命令而成为高手是不可能的。

乐观 发表于 2015-1-16 21:09:19

Linux教程之对Linux专家十分有效的20个命令

熟悉并掌握安装Linux,安装是学习的前提。目前较常见的安装方法有二种:

山那边是海 发表于 2015-1-19 05:25:11

下面看看一个让人无法回答的问题:“救命各位高手,向你们请教一些问题:如何在Linux下配制HTTP、FTP、Samba、DNS、DHCP、Sendmail服务器,谢谢”这样的问题。

不帅 发表于 2015-1-27 23:49:35

请问谁有Linux的学习心得的吗?简单的说说?

深爱那片海 发表于 2015-2-5 16:29:57

尽量不要提问纯属是扯蛋.学习Linux特别是自己一个人初学入手的时候没人教很困难.当然如果可以的话平时多去买些Linux书...对学习Linux很有帮助.

第二个灵魂 发表于 2015-2-13 00:54:21

学习Linux应具备的。[书籍+网络资源]

蒙在股里 发表于 2015-3-3 12:00:48

你需要提供精确有效的信息。Linux这并不是要求你简单的把成吨的出错代码或者数据完全转储摘录到你的提问中。

再见西城 发表于 2015-3-11 11:12:23

工具书对于学习者而言是相当重要的。一本错误观念的工具书却会让新手整个误入歧途。目前国内关于Linux的书籍有很多不过精品的不多。

活着的死人 发表于 2015-3-18 14:21:29

Windows?是图形界面的,Linux类似以前的?DOS,是文本界面的,如果你运行了图形界面程序X-WINDOWS后,Linux?也能显示图形界面,也有开始菜单、桌面、图标等。

变相怪杰 发表于 2015-3-26 09:54:01

了解Linux的网络安全,系统的安全,用户的安全等。安全对于每位用户,管理员来说是非常重要的。
页: [1]
查看完整版本: Linux教程之对Linux专家十分有效的20个命令