*
Linux应用与开发
Linux系统使用深入
回顾
如何通过修改配置文件手动加入用户?
用户名字hadoop 基本组为hadoop,组ID和用户ID为2000,附加组为mygroup?
Linux系统使用深入
/etc/passwd 添加:hadoop:x:2000:2000:hadoop:/home/hadoop:/bin/bash
/etc/group 添加:mygroup:x:5001:hadoop
hadoop:x:5000:
/etc/shadow 添加:hadoop:!!:15000:0:99999:7:::
cp -r /etc/skel/ /home/hadoop/
chown -R /home/hadoop/
chmod -R go= /home/hadoop
oppenssl passwd -1 -salt '33333333' >>/etc/shadow
Linux系统使用深入
回顾
普通用户和管理员用户创建文件和目录的权限默认是?
改umask为023,再创建文件的权限是多少,exit后再登陆,umask为多少?
Linux系统使用深入
基于用户登录的shell类型
登陆式shell
正常登陆的终端
su - usename切换的shell
su -l usename切换的shell
非登陆式shell
su usename切换的shell
图形终端下打开的命令终端
自动执行的shell脚本
Linux系统使用深入
bash的配置文件
全局配置
/etc/profile,/etc//*.sh,/etc/bashrc
个人配置
~/.bash_profile,~/.bashrc
Linux系统使用深入
bash的配置文件
profile类
设定环境变量,个人优先
在登录前运行的命令或者脚本
bashrc类
设定本地变量
定义命令别名
Linux系统使用深入
bash的配置文件
登录式shell
首先访问/etc/profile,读取/etc//*.sh,读取~/.bash_profile,读取~/.bashrc,最后读取/etc/bashrc
非登录式shell
首先读取~/.bashrc,读取/etc/bashrc,读取/etc//*.sh
Linux系统使用深入
bash的配置文件
要定义一个自己用户有效的命令别名?
用户登录时显示一句话?
Linux系统使用深入
高级文本查找grep
grep egrep fgrep
Global Regular Expression Print,表示全局正则表达式版本,它的使用权限是所有用户
根据某种模式(Pattern)搜索文本,并将符合模式的文本行显示出来
模式:由文本字符和正则表达式的元字符组合而成的匹配条件
grep [options] PATTERN [FILE...]
Linux使用深入2 来自淘豆网m.daumloan.com转载请标明出处.