Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux #160

Open
youngjuning opened this issue Aug 26, 2018 · 1 comment
Open

Linux #160

youngjuning opened this issue Aug 26, 2018 · 1 comment
Assignees
Labels

Comments

@youngjuning
Copy link
Owner

youngjuning commented Aug 26, 2018

@youngjuning youngjuning self-assigned this Aug 26, 2018
@youngjuning
Copy link
Owner Author

youngjuning commented Aug 26, 2018

常用命令

卸载软件

普通的 remove 命令不能彻底清除软件,清楚配置信息需要执行下面的命令:

  • apt-get remove --purge softname
  • apt-get autoremove
  • apt-get clean
  • dpkg -l |grep ^rc|awk '{print $2}'
  • xargs dpkg -P
  • apt-get update

Linux用户管理

添加用户

-m表示在home目录下新建与用户名同名的文件夹

$ useradd -m username

切换到root用户

$ su

切换到普通用户

$ su user

修改用户密码

$ passwd user

输入新的UNIX密码:password
重新输入新的UNIX密码:password

删除用户

$ userdel username

未分类

  1. 查看Linux硬盘使用情况:df -hi
  2. 显示Linux磁盘信息: fdisk -l
  3. 查看Ubuntu的版本号:cat /etc/issue
  4. 查看Linux内核版本的命令: cat /proc/version
    /proc文件系统,它不是普通的文件系统,而是系统内核的映像,也就是说,该目录中的文件是存放在系统内存之中的,它以文件系统的方式为访问系统内核数据的操作提供接口。
  5. 将某一个用户加入root组:usermod -G root keny
  6. find:find [/] [-name] filename/directoryname

服务

  • 启动服务: /etc/init.d/nginx start or service nginx start
  • 重启服务: /etc/init.d/nginx resstart or service nginx restart
  • 停止服务:/etc/init.d/nginx stop or service nginx stop

@youngjuning youngjuning changed the title Linux常用命令 Linux Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant