Linux命令行与shell脚本编程大全(基础介绍)

1、介绍,用法,实用
2、/etc/inittab 运行级别
systemctl set-default TARGET.target
3、桌面环境:x window,kde,gnome
4、ls -F //区分目录和文件的输出
ls -F -R
ps l
ps -o stat,cmd,pid
5、排序
sort 按字符
sort -n 按数字大小
sort -k3
sort -r 反转
sort -t “:” -k 3 -n /etc/passwd 指定分隔符后的排序
6、grep
grep -n 带行号
grep -c//只统计有几行是符合的
grep -e a -e b //多个匹配,or
7、echo 《Linux命令行与shell脚本编程大全(基础介绍)》HOME/.bash_profile
《Linux命令行与shell脚本编程大全(基础介绍)》HOME/.bash_login
《Linux命令行与shell脚本编程大全(基础介绍)》HOME/.bashrc
12、非交互式时执行:《Linux命令行与shell脚本编程大全(基础介绍)》{mycor[1]}
echo 《Linux命令行与shell脚本编程大全(基础介绍)》{#mycor[@]} //列出长度
14、/etc/shadow 字段解释

《Linux命令行与shell脚本编程大全(基础介绍)》 image.png

《Linux命令行与shell脚本编程大全(基础介绍)》 image.png

15、查看useradd -D 默认值

useradd -c comment -d 目录 -e exire_date -f inactive_days -g -G -km -M -p -s

《Linux命令行与shell脚本编程大全(基础介绍)》 image.png

16、userdel -r test

usermod -l 修改登录名 -p 修改密码 -L锁定 -U解除锁定

passwd

chpasswd

change -E修改密码的过期日期

《Linux命令行与shell脚本编程大全(基础介绍)》 image.png

chfn 修改备注信息

chsh -s 修改默认shell

17、groupadd xx

usermod -G xx rich

groupmod -n newname oldname 修改组名

18、文件权限

-文件 d 目录 l 链接 C字符设备 B块设备

umask

u,g,o u-r

19、yum list installed

yum provides /etc/yum.conf //该文件属于哪个软件包

20、vi 替换 :%s/old/new/g

《Linux命令行与shell脚本编程大全(基础介绍)》 image.png

    原文作者:SkTj
    原文地址: https://www.jianshu.com/p/a96a442cc6ca
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞