Ubuntu系统机制学习

参考网站:

http://jingyan.baidu.com/article/db55b609a3f6274ba30a2fb8.html (ubuntu环境变量设置)

http://blog.chinaunix.net/uid-24250828-id-3233893.html (ubuntu安装配置详解)

http://jingyan.baidu.com/article/fa4125acb7328628ac70920e.html (设置系统时间)

 

Ubuntu系统机制学习

一、Ubuntu常用系统文件

  1. 系统环境变量

/etc/environment

  1. sudo vi /etc/environment

配置完成之后,执行如下命令使生效

  1. source /etc/environment
  2.     

系统环境变量设置文件:对所有系统用户都有效

  /etc/environment

  /etc/profile

  /etc/bash.bashrc

 

  1. 用户环境变量

~/.bashrc

  1. Sudo vi ~/.bashrc

配置完成之后,执行如下命令使生效

  1. source ~/.bashrc

  用户环境变量设置文件:仅对当前的用户有效

  ~/.profile

  ~/.bash_profile 或者 ~./bash_login

  ~/.bashrc

 

例如:

export PATH=/opt/EmbedSky/4.3.3/bin:$PATH

  1. 系统lib包路径:

Ld.so.conf

Ld.so.conf.d

  1. ubuntu apt-get源目录

/etc/apt/source.list

/etc/apt/source.list.d

 

 

二、Ubuntu启动进入到命令行

http://www.jb51.net/os/Ubuntu/339988.html

启动时,在grub菜单按下e

找到quiet splash,删除,替换文text

ctrl+X,进入命令行。

 

  1. Ubuntu添加用户

ubuntu建用户最好用adduser,虽然adduseruseradd是一样的在别的linux糸统下,但是我在ubuntu下用useradd时,并没有创建同名的用户主目录。

  1. su root
  2. adduser mohanlin

Adding user `mohanlini' ...

Adding new group `mohanlini' (1002) ...

Adding new user `mohanlini' (1002) with group `mohanlini' ...

Creating home directory `/home/mohanlini' ...

Copying files from `/etc/skel' ...

  1. Enter new UNIX password:
  2. Retype new UNIX password:

Changing the user information for mohanlini

Enter the new value, or press ENTER for the default

Full Name []: mohanlin(等信息一路回车)

Room Number []:

Work Phone []:

Home Phone []:

Other []:

  1. Is the information correct? [Y/n] y

修改sudo权限

  1. su root
  2. vi /etc/sudoers
  3. yy 复制一行
  4. p 粘贴一行
  5. :wq!退出

四、删除用户

  1. userdel mohanlin

五、查看某个库是否安装或安装版本

最简单的方法,随便找个boost的库:

  1. find / -name libboost_random.so* 

下输出是什么:

/usr/lib/x86_64-linux-gnu/libboost_random.so

/usr/lib/x86_64-linux-gnu/libboost_random.so.1.55.0

/usr/local/MATLAB/R2016a/bin/glnxa64/libboost_random.so.1.56.0

 

六、查看文件大小

Ubuntu下查看文件夹大小

  1. du –sh

ubuntu下查看硬盘容量

  1. df –h

七、复制文件夹

  1. cp -R file1 file2
原文地址:https://www.cnblogs.com/yizhichun/p/6433910.html