博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
RH033读书笔记(1)-Lab2 Linux Usage Basics
阅读量:7054 次
发布时间:2019-06-28

本文共 3938 字,大约阅读时间需要 13 分钟。

Lab2 Linux Usage Basics

Goal:
logging in
changing passwords
viewing and editing files

Sequence 1: Logging in and using basic Linux commands

1. Pressing: Ctrl-Alt-F1

2. stationX: student

Password:

3. [student@stationX ~]$ passwd

4. New UNIX password: student

BAD PASSWORD: it is based on your username
New UNIX password:

5. New UNIX password: LzhfP@ssw0rd

Retype new UNIX password: LzhfP@ssw0rd
passwd: all authentication tokens updated successfully.

6. [student@stationX ~]$ exit

stationX: student
Password: LzhfP@ssw0rd
[student@stationX ~]$

7. [student@stationX ~]$ su -

Password: <root password>
[root@stationX ~]#

8. [root@stationX ~]# passwd student

New UNIX password: redhat
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password: redhat
passwd: all authentication tokens updated successfully.

9. root can set any password for users. still it will get a warning.

10. [root@stationX ~]# cat /etc/issue

Red Hat Enterprise Linux Server release 5
Kernel \r on an \m

11. [root@stationX ~]# nano /etc/issue

12. Add a new line at the top of /etc/issue to make it more friendly:

Welcome!
typing Ctrl-X.
press Enter to confirm.

13. [root@stationX ~]# cat /etc/issue

14. Ctrl-Alt-F2 to Ctrl-Alt-F6

Ctrl-d

15. Clean up:

Return to the first virtual console by typing Ctrl-Alt-F1.
exit
exit
Return to the graphical login by typing Ctrl-Alt-F7

16. echo "set completion-ignore-case on" >> ~/.inputrc

~/.inputrc:
 
$include /etc/inputrc # inherit global inputrc settings
set completion-ignore-case on
# ...other custom settings here...
 
------------------------------------------------------------------
Soft Link vs. Hard Link

Unix files consist of two parts: the data part and the filename part.

The data part is associated with something called an 'inode'. The inode carries the map of where the data is, the file permissions, etc. for the data.

The filename part carries a name and an associated inode number.

More than one filename can reference the same inode number; these files are said to be 'hard linked' together.

On the other hand, there's a special file type whose data part carries a path to another file. Since it is a special file, the OS recognizes the data as a path, and redirects opens, reads, and writes so that, instead of accessing the data within the special file, they access the data in the file named by the data in the special file. This special file is called a 'soft link' or a 'symbolic link'(aka a 'symlink').

Now, the filename part of the file is stored in a special file of its own along with the filename parts of ther files; this special file is called a directory. The directory, as a file, is just an array of filename parts of other files.

When a directory is built, it is initially populated with the filename parts of two special files: the '.' and '..' files. The filename part for the '.' file is populated with the inode# of the directory file in which the entry has been made; '.' is a hardlink to the file that implements the current directory.

The filename part for the '..' file is populated with the inode# of the directory file that contains the filename part of the current directory file. '..' is a hardlink to the file that implements the immediate parent of the current directory.

The 'ln' command knows how to build hardlinks and softlinks; the 'mkdir' command knows how to build directories (the OS takes care of the above hardlinks).

There are restrictions on what can be hardlinked (both links must reside on the same filesystem, the source file must exist, etc.) that are not applicable to softlinks (source and target can be on seperate file systems, source does not have to exist, etc.). OTOH, softlinks have other restrictions not shared by hardlinks (additional I/O necessary to complete file access, additional storage taken up by softlink file's data, etc.)

In other words, there's tradeoffs with each.

 

转载于:https://www.cnblogs.com/thlzhf/archive/2013/03/25/2981352.html

你可能感兴趣的文章
linux下的java开发环境
查看>>
Bootstrap使用记录
查看>>
从一场场大型网站灾难过后的BUG:根
查看>>
Linux系统下怎样利用nc命令来监控检测服务器的端口使用情况
查看>>
git命令总结
查看>>
tomcat高访问jvm配置
查看>>
谢烟客---------二进制安装MariaDB,管理关系型数据库的基本组件
查看>>
JS 判断手机浏览器
查看>>
Xcode WorkSpace静态库多项目依赖
查看>>
【C语言】 实现memset
查看>>
JS 流程设计器
查看>>
blog小记
查看>>
我的友情链接
查看>>
fileoper.py
查看>>
我的友情链接
查看>>
shell脚本将指定目录下前3天日期目录使用tar打包后并将其删除源日期目录
查看>>
类的静态成员
查看>>
比较react和flex的设计哲学
查看>>
老李案例分享:Weblogic性能优化案例
查看>>
搭建本地yum源
查看>>