欢迎来到天天文库
浏览记录
ID:45756639
大小:93.74 KB
页数:6页
时间:2019-11-17
《linux常用命令_电脑基础知识_IT计算机_专业资料》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、1>创建文件:touchfilename2、创建文件夹:mkdirfoldername3、(强制)删除文件:rm(-f)filename4、强制(f)向下递归删除文件夹:rm-rffoldername5、压缩文件为zip:zip-rtest.zip./*(将当前目录下所有文件和文件夹压缩为test.zip)6、解压缩zip:unzip-o-d/tmptest.zip(将当前目录Ttest.zip文件解压缩到/tmp目录下)■O:不提示的情况下覆盖文件;-d:-d/tmp指明将文件解压缩到/tmpM录下7、重命名文件(夹):mvAB(A换成B)8、査看端口进程pid:netstat-anp
2、
3、grep;査看进程情况:ps-ef
4、grep(root6datanode4bin]・nEptatIqrep8080tcp00:::8080:::*LISTEN(^31851^)ava[root@datanode4bin]Ips匚e£lqrep31851root2669425523019:37pts/l00:00:00grep31851root3185110Nov20?00:08:02/opt/java/jdkl.6.0_35/bin/java-Djava.util.logginging.properties-Djava.util•logging.manager°o
5、rg•apache.juli•ClassLoaderLogManager*Djava•endorsed«dh/opt/tmp/apache.0•56/bin/bootstrap.jar:/opt/tmp/apache-tomcat-7.0.56/bin/tomcat-juli.jatalina•home«/opt/tmp/apache-tomcat-7.0.56・Djava•io.tmpdir=/opt/tmp/apache-tomcat-7•0•56/temporg•、9、拷贝服务器A文件或H录到服务器B:可以用scp命令(1)scpuser@remote.machine:/remot
6、e/path/local/path将远程linux主机上/remote/path的文件copy到本主机的/local/path目录(2)scp/local/pathuser@remote.machine:/remote/path将本主机的/local/pathH录copy到远程linux主机上/remote/path的文件例:将10.68.6.114/opt/tomcat目录及子目录拷贝到10.68.6.121/opt目录下[root@datanode2#ifconfigethlLinkencap:EthernetHWaddr00:16:3E:3B:E5:E3inetaddr:10.68
7、.6.114Beast:10.68.6.255Mask:255.255.255.0inet6addr:feff0r:216:3eff:fe3b:e5e3/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:1404976errors:0dropped:0overruns:0frame:0TXpackets:1595920errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000RXbytes:1122173258(1.0GiB)TXbytes:
8、944516196(900.7MiB)Interrupt:164loLinkencap:LocalLoopbackinetaddr:127.0.0.1Mask:255.0.0.0inet6addr:::1/128Scope:HostUPLOOPBACKRUNNINGMTU:16436Metric:1RXpackets:94errors:0dropped:0overruns:0frame:0TXpackets:94errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:5366(5.2KiB)TXbytes:5
9、366(5.2KiB)[root@datanode2〜]#
10、scp/opt/tomcat/root@10・68・6・121:/optI10、修改主机名(1)临时修改:重川后恢复-]#-]*-]#10.6echo$PS1[root@namenode2#namenode2•iop•com:[root0namenode2[root@namenode2wangfen[root0nnode2[root@namenode2hostnamesud
此文档下载收益归作者所有