~~~~常常用到的Linux命令~~~~

浏览: 1302

一条语句改系统/用户的bash设置:

sudo gedit ~/.bashrc; gedit ~/.profile; gedit /etc/bash.bashrc; gedit /etc/profile

查看CPU信息

cat /proc/cpuinfo | grep vmx       ##(for Intel CPU)

or 

cat /proc/cpuinfo | grep svm       ##(for AMD CPU)

  • 是否支持虚拟化:
  • 查看核心数:
    •     cat /proc/cpuinfo|grep processor|wc -l

sudo gedit ~/.bashrc; gedit ~/.profile; gedit /etc/bash.bashrc; gedit /etc/profile

  • 启动postgresql服务:sudo service postgresql start
  • 查看版本信息:sudo -u postgres psql --version
  • 查看java版本:java -version
  • 查psql位置:locate psql | grep /bin
  • 链接服务器,登录postgres: ssh username@host
  • postgres 登录:sudo -u postgres psql
  • 普通用户test1登录:psql -U test1 -d richard_restore -W;  su -l postgres
  • 编译环境变量: source /etc/profile
  • 重启postgresql服务:richard_ma@richardma:/etc/postgresql/9.5/main$ /etc/init.d/postgresql restart
  • 编辑配置文件:richard_ma@richardma:/etc/postgresql/9.5/main$ sudo vi pg_hba.conf 
  • 查找某一文件:sudo find / -name postgresql.conf   [sudo] password for richard_ma:  (Local) /etc/postgresql/9.5/main/postgresql.conf  (Server) /var/lib/pqsql/9.2/data/pg_log/
  • 查软件版本:aptitude show 软件名 dpkg -l软件名
  • 查安装路径:dpkg -L 软件名  whereis 软件名
  • 系统安装盘的话,命令把光驱挂载到/mnt目录下: mount /dev/cdrom /mnt 
推荐 0
本文由 Yuchi608 创作,采用 知识共享署名-相同方式共享 3.0 中国大陆许可协议 进行许可。
转载、引用前需联系作者,并署名作者且注明文章出处。
本站文章版权归原作者及原出处所有 。内容为作者个人观点, 并不代表本站赞同其观点和对其真实性负责。本站是一个个人学习交流的平台,并不用于任何商业目的,如果有任何问题,请及时联系我们,我们将根据著作权人的要求,立即更正或者删除有关内容。本站拥有对此声明的最终解释权。

0 个评论

要回复文章请先登录注册