ubuntu常见命令

文件命令

查看文件内容命令有tail、cat、head

tail -f test.log   //-f表示会更新

tail命令能实时查看到文件信息,适合debug时查看log信息

cat [选项] filename

cat 主要用于一次性显示某个文件或者几个文件合并

df -h 查看目录磁盘运用

du -sh *查看当前目录磁盘运用

查看已经连接的服务端口(ESTABLISHED)

netstat -a

查看所有的服务端口(LISTEN,ESTABLISHED)

netstat -ap

查看指定端口,可以结合grep命令:

netstat -anp | grep 8080

 也可以使用lsof命令:

lsof -i:8888

若要关闭使用这个端口的程序,使用kill + 对应的pid

kill -9 PID号

 

查看文件,文件夹属性:
#ls -l filename
#ls -ld foldername
3、查看文件的三个时间 atime ,ctime, mtime

# ls -l --full-time /etc/man.config mtime
# ls -l --time=atime --full-time /etc/man.config atime
# ls -l --time=ctime --full-time /etc/man.config ctime

启动mongodb服务

net start MongoDB

 

tomcat启动

nohup sh catalina.sh run

chmod修改用户权限

sudo chmod 777 /code/readme.txt

clear用来清空面板

 

注释proile里的环境变量

vi /etc/profile

#使刚刚的配置生效 source /etc/profile

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值