跳至主要内容
Linux 命令行概览
文件管理
- 切换目录 cd
- 查看目录 pwd, ls
- 打印文件到命令行 cat
- 编辑文件 vim, nano
- 改变文件所属用户 chown
- 改变文件所属组 chgrp
- 下载文件 curl, wget
- 搜索文件 find, grep, locate
- 显示部分内容 head, tail, more, less
运行程序
- 直接运行 ./
- 退出 ctrl + c
- 后台运行 nohup [command] > nohup.log 2>&1 &;
- 强制关闭 ps -ef | grep [keyword] | awk '{print $2}' | xargs kill -9
- 通过 .service 管理 systemctl enable | start | stop | restart x.service
关机和重启
- 关机 poweroff, halt, init 0
- 重启 restart, init 6
用户管理
- 创建用户 useradd 
- 设置密码 passwd
安装软件
- RPM安装 rpm -ivh x.rpm
- RPM查找 rpm -qa | grep jdk
- RPM列表 rpm -aq | less
- YUM安装 yum install [program_name]
- YUM查找 yum search [program_name]
- YUM配置文件 /etc/yum.repos.d/CentOS-Base.repo
 
 
 
 
 
 
 
 
 
 
 
 
评论
发表评论