LINUX REDHAT第一单元文档

简介:

进入系统

普通用户 studnet:

点击student 输入密码 进入普通用户student

超级用户 root:

单击                    >not listed

输入超级用户名    >root

键入密码             >********


语言调整
Applications    ----->system tools---->settings ----->Region & language --->language 

打开命令行---> reboot


  1. 行提示符

[root@localhost Desktop]# 
root                                         当前用户 root:超级用户

@                                             分隔符

localhost                                  主机名称

Desktop                                   当前工作目录

#                                              #:超级用户 $:普通用户

20170330104410258

2.切换用户

超级用户切换普通用户 [root@localhost Desktop]# su - student

退出普通用户  [student@localhost ~]$ exit

20170330104633806

普通用户切换超级用户

[student@localhost ~]$ su - root
Password:

20170330104753873

高级用户切换到低级用户不需要密码,低级用户切换到高级或者平级用户的切换需要密码


3.虚拟控制台

Ctrl+Alt+F(1|7)    进入图形
Ctrl+Alt+F(2~6) 进入虚拟控制台

Red hat Enterprise Linux Server 7.2 (Maipo)    ##系统版本
Kernel 3.10.0-123.el7.x86_64 on an x86_64    ##内核版本,系统位数

desktop0 login:root                ##登陆用户名称输入
Password:                    ##密码输入无回显


4.命令的执行

命令必须在行提示符之后输入

20170330105122464
命令格式
命令 参数 目标

例如:rm -rf -file

20170330105255669

ctrl +c    ##撤销命名的执行
命令参数
-参数    ##单词缩写
--参数    ##单词的全拼


5.命令的帮助
whatis 命令    ##查看命令的功能
命令 --help    ##查看命令的帮助
[]        ##选择加入的内容,可加可不加
...        ##加入的内容个数任意
<>        ##内容在命令执行过程当中必须要加

20170330105407992



6.系统的使用基础方法

1)系统登陆

图形登陆方式:鼠标点击用户 输入密码进入系统

文本登陆方式:gnome-session-quit --force (退出当前系统)


2)工作界面转换

ctrl+alt+方向键上(方向键下)


3)开始bash

鼠标右键选择Open in Terminal

Applications>Utilities>Terminal

gnome-terminal
ctrl+shift+n        ##在新窗口中打开shell
ctrl+shift+t        ##同一个窗口中打开新的tab
退出:exit | ctrl+d


4)系统关机,重启

重启
reboot                        立即重启

init 6                           重启

shutdown -r now        设定世界重启
关机
poweroff                      立刻关机

init 0                            关机

shutdown -h now        设定时间关机


5)锁屏

ctrl + alt +l         rhel 7.0

win + l                rhel 7.2


简单的系统命令

1)date

watch -n -1 date         让命令每秒执行一次

20170330110800129


date  03301110              将时间设定为 3月30日 11点10分

20170330111020646


date  -d +xday -xday              查看x天前 或x天后时间


20170330111238225

+%....            设定date的输出格式 date --help 可详细了解

20170330111423865


2)passwd

passwd 修改用户密码

a.root用户

修改root密码

[root@localhost ~]# passwd root
Changing password for user root.
New password: 
BAD PASSWORD: The password fails the dictionary check - it is too simplistic/systematic
Retype new password: 
passwd: all authentication tokens updated successfully.

20170330111730243

修改普通用户

[root@localhost ~]# passwd student 
Changing password for user student.
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 
passwd: all authentication tokens updated successfully.

20170330111925666


b.普通用户修改密码

普通用户无法修改root用户密码

[student@localhost ~]$ passwd
Changing password for user student.
Changing password for student.
(current) UNIX password:                                                           输入当前密码
New password:                                                                           输入新密码
BAD PASSWORD: The password is shorter than 7 characters    密码必须大于7个个字符
New password:                                                                           重新输入密码
BAD PASSWORD: The password fails the dictionary check - it is too simplistic/systematic
New password:                                                                             重新输入密码
Retype new password:                                                                  在输入一次
passwd: all authentication tokens updated successfully.                成功

20170330115840887

passwd    参数    用户名称
    -S    student        ##用户密码信息
    --status student
    -l    student        ##锁定帐号
    -u    student        ##解锁
    -n 1    student        ##设定密码最短有效期
    -x 30    student        ##设定密码最长有效期
    -w 3    student        ##警告期
    -i 2    student        ##设定用户非活跃天数
    -d    student        ##清除用户密码
监控passwd密码信息
watch -n 1 passwd -S student


[root@localhost ~]# passwd -S student 
student PS 2017-03-30 0 99999 7 -1 (Password set, SHA512 crypt.)
[root@localhost ~]# passwd -l student 
Locking password for user student.
passwd: Success
[root@localhost ~]# passwd -u student 
Unlocking password for user student.
passwd: Success
[root@localhost ~]# passwd -n 1 student 
Adjusting aging data for user student.
passwd: Success
[root@localhost ~]# passwd -n 999 student 
Adjusting aging data for user student.
passwd: Success
[root@localhost ~]# passwd -w 30 student 
Adjusting aging data for user student.
passwd: Success
[root@localhost ~]# passwd -i 2 student 
Adjusting aging data for user student.
passwd: Success
[root@localhost ~]# passwd -d student 
Removing password for user student.
passwd: Success

20170330120407297


3)file

file 文件名称             查看文件类型

20170330120105451


4)文件的查看

cat        filename    ##显示文件的全部内容
less        file        ##分页浏览,按“q”退出
head        filename    ##显示一个文件的前几行
head -n 5    filename    ##前五行
tail        filename    ##显示文件后几行
tail -n 5     filename    ##显示一个文件的后5行

201703301209036612017033012092731720170330120936768201703301209431152017033012094926820170330120954549


5)wc统计文件容量信息

wc    -l    行数
        -w    字数
        -c    字节数
        -m    字符数

20170330121202112


6)history历史

history            ##显示历史
hostory -c        ##清除当前环境当中的历史命令
!数字            ##执行第多少行命令
!字母            ##执行最近一条以这个字母开头的命令
ctrl +R +关键字        ##执行最近一条含有这个关键字的命令
上下键            ##逐行调用命令

201703301216180052017033012162476420170330121630952

7)linux 快捷键

左右            ##一个字符一个字符移动
ctrl +左右        ##一个字一个字移动
ctrl    + a         ##光标移动到行首
        + e         ##光标移动到行尾
        + u         ##光标所在位置删除到行首
        + k         ##光标所在位置删除到行尾
        + r+关键字    ##调出最近一条含有关键字的命令
        + c         ##撤销以输入的命令
        + d         ##关闭当前环境
    + L        ##清空屏幕
    + shift + c    ##复制
    + shift + v    ##粘贴
        + shift + t     ##在现有shell中重新打开一个table        
    + shift + n    ##在shell中打开一个新的shell
        + shift + pageup|pagedown     ##切换table
        + alt + l          ## 锁屏
        + alt +上|下    ##切换工作界面
        + alt + f1|f7   ##进入图形界面
        + alt + f2-f6   ##进入虚拟控制台  



本文转自Super_MONKEY 51CTO博客,原文链接:http://blog.51cto.com/supermk/1911697

相关文章
|
28天前
|
存储 算法 Shell
【Shell 命令集合 文档编辑】Linux 格式化输出 ispell命令使用指南
【Shell 命令集合 文档编辑】Linux 格式化输出 ispell命令使用指南
32 3
|
28天前
|
存储 Shell Linux
【Shell 命令集合 文档编辑】Linux 格式化输出 Shell fold命令使用指南
【Shell 命令集合 文档编辑】Linux 格式化输出 Shell fold命令使用指南
32 2
|
28天前
|
算法 Shell Linux
【Shell 命令集合 文档编辑】Linux 格式化文本文件fmt命令使用教程
【Shell 命令集合 文档编辑】Linux 格式化文本文件fmt命令使用教程
32 2
|
28天前
|
数据采集 Shell Linux
【Shell 命令集合 文档编辑】Linux 字符转换或删除 tr 命令使用指南
【Shell 命令集合 文档编辑】Linux 字符转换或删除 tr 命令使用指南
32 0
|
1月前
|
数据可视化 Linux API
如何在Linux使用docker部署Swagger Editor并实现无公网IP远程协同编辑API文档
如何在Linux使用docker部署Swagger Editor并实现无公网IP远程协同编辑API文档
|
28天前
|
Shell Linux C语言
【Shell 命令集合 文档编辑 】Linux 递归搜索指定字符串 rgrep命令使用指南
【Shell 命令集合 文档编辑 】Linux 递归搜索指定字符串 rgrep命令使用指南
14 0
|
28天前
|
算法 Shell Linux
【Shell 命令集合 文档编辑】Linux 检查文本文件中的拼写错误 spell 命令使用指南
【Shell 命令集合 文档编辑】Linux 检查文本文件中的拼写错误 spell 命令使用指南
34 0
|
1月前
|
安全 Linux 网络安全
如何在 VM 虚拟机中安装 Red Hat Enterprise Linux 9.3 操作系统保姆级教程(附链接)
如何在 VM 虚拟机中安装 Red Hat Enterprise Linux 9.3 操作系统保姆级教程(附链接)
88 0
|
28天前
|
Shell Linux C语言
【Shell 命令集合 文档编辑】Linux 在文件中查找指定的字符串 fgrep命令使用指南
【Shell 命令集合 文档编辑】Linux 在文件中查找指定的字符串 fgrep命令使用指南
34 2
|
9天前
|
Linux 网络安全
linux免密登录报错 Bad owner or permissions on /etc/ssh/ssh_config.d/05-redhat.conf
linux免密登录报错 Bad owner or permissions on /etc/ssh/ssh_config.d/05-redhat.conf
19 1