码迷,mamicode.com
首页 > 系统相关 > 详细

Linux 指令整理

时间:2018-02-12 11:17:56      阅读:477      评论:0      收藏:0      [点我收藏+]

标签:open   软连接   nod   表示   档案   direct   node   following   lin   

1.【su - 用户名】 是完整的切换到一个用户环境,【su 用户名】只切换用户,不改变系统环境。如下

mes-79:~ # su oracle
oracle@mes-79:/root> ls
ls: cannot open directory .: Permission denied
oracle@mes-79:/root> cd
oracle@mes-79:~> sqlplus /nolog
If ‘sqlplus‘ is not a typo you can run the following command to lookup the package that contains the binary:
    command-not-found sqlplus
bash: sqlplus: command not found
oracle@mes-79:~> 

2  .代表当前的目录,也可以使用 ./ 来表示; .. 代表上一层目录,也可以 ../ 来代表。

3. 28 Feb 11 15:14为源文件的创建时间,test03是cp过来的。

[root@sesprd testcp]# ls -l
total 4
-rw-r--r--. 1 oracle dba 28 Feb 11 15:14 test03
[root@sesprd testcp]# ^C [root@sesprd testcp]# ls -l --time=a total 4 -rw-r--r--. 1 oracle dba 28 Feb 12 09:51 test03

 4.硬链接(hard link)与软连接(symbolic link)

来看一段语句,ln为制作连接档指令,ln不加参数即为硬连接,ln -s 为创建软连接。硬链接不同于文件的复制,源文件的数据并没有得到复制,类似一个别名的概念,都指向相同的inode与block,这里inode为393218.硬连接不占用inode与block,而软连接二者都会占用,因为其所建立的档案为独立的新的档案。软连接相当于window系统下的快捷方式。除硬连接二者同步外,如果修改test.so,test03的内容会同样改变。

[root@sesprd testcp]# ln test03 testln
[root@sesprd testcp]# ll -il
total 8
393218 -rw-r--r--. 2 oracle dba 28 Feb 11 15:14 test03
393218 -rw-r--r--. 2 oracle dba 28 Feb 11 15:14 testln
[root@sesprd testcp]# cat testln
ppppwwrrrrrrrrr:rrrrrrrooor
[root@sesprd testcp]# cat test03
ppppwwrrrrrrrrr:rrrrrrrooor
[root@sesprd testcp]# ln -s test03 test.so
[root@sesprd testcp]# ls
test03  testln  test.so
[root@sesprd testcp]# cat test.so
ppppwwrrrrrrrrr:rrrrrrrooor
[root@sesprd testcp]# rm test03
rm: remove regular file ‘test03’? y
[root@sesprd testcp]# cat test.so
cat: test.so: No such file or directory
[root@sesprd testcp]# cat testln
ppppwwrrrrrrrrr:rrrrrrrooor
[root@sesprd testcp]# ls -il
total 4
393218 -rw-r--r--. 1 oracle dba  28 Feb 11 15:14 testln
393219 lrwxrwxrwx. 1 root   root  6 Feb 12 10:24 test.so -> test03
[root@sesprd testcp]# 

 

Linux 指令整理

标签:open   软连接   nod   表示   档案   direct   node   following   lin   

原文地址:https://www.cnblogs.com/gudaozi/p/8443702.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!