美文网首页
Linux常用命令

Linux常用命令

作者: 斜杠青年Cindy | 来源:发表于2018-11-29 18:32 被阅读16次

    1、常见的几种查看server.log的文件内容的方式?

    Linux查看日志文件内容命令:tail、cat、head

    2、编辑istester.conf文件,并查看文件前10行内容和后10行内容?

    vi istester.conf

    #前10行

    head -n 10 istester.conf

    #后10行

    tail -n 10 istester.conf

    3、删除istester.conf文件?

    rm -rf istester.conf

    4、删除istester.com文件夹?

    rm  -rf istester.com

    (PS:实际工作中,【rm】命令建议少用,毕竟很危险,可以用【mv】来代替,移动需要删除到的文件,到【垃圾区】,定期自动清理。)

    5、如何直接下载某个文件?

    wget http://download.redis.io/releases/redis-3.2.0.tar.gz

    或者用 curl -O http://download.redis.io/releases/redis-3.2.0.ter.gz

    6、把当前文件istester.conf拷贝到目标服务器112.74.75.239服务器的 /ido/xu/文件夹下?

    scp ./istester.conf root@112.74.75.239:/ido/xu/

    7、把当前文件夹istester.com拷贝到另外一台目标服务器112.74.75.239服务器的 /ido/xu文件夹下?

    scp -r ./istester.com root@112.74.75.239:/ido/xu/

    8、查看后台所有Java进程

    ps -ef | grep java

    9、查看80端口是否被占用?

    netstat -nltp | grep 80

    10、结束后台某进程?

    kill PID   或者 kill -9 PID

    11、将istester.conf文件改为可执行权限?

    chmod u + x istester.conf 或者   chmod 755 istester.conf

    12、更改Linux服务器系统时间为 2018/04/09 22:22

    date -s 日期/时间

    date -s 2018/04/09

    date -s 22:22

    13、实时看最新的100行Log?

    tail -100f istester.log

    14、Linux服务器,网络时间同步?

    ①、寻找一个网络时间服务器,比如一些国家授时中心

    微软公司授时主机(美国)

    time.windows.com

    台警大授时中心(台湾)

    asia.pool.ntp.org

    中科院授时中心(西安)

    210.72.145.44

    网通授时中心(北京)

    219.158.14.130

    ②、怎样去同步授时中心的时间?

    ntpdate asia.pool.ntp.org【此命令就是去同步授时中心的时间】

    相关文章

      网友评论

          本文标题:Linux常用命令

          本文链接:https://www.haomeiwen.com/subject/hlnfcqtx.html