Linux 基础与应用教程 002

1.ls 

list

2.ls -a 查看全部文件     以.开头的是隐藏文件

3.ls 、根目录

3 ls  -l(long)

4.-:二进制文件  d:目录  l:软连接文件

5.-rw-r--r--

 U(所有者) g(所属组)  o(其他人)

6.  执行,实行;贯彻;实现;完成;

7.[root@localhost ~]# ls -ld /etc

8.

[root@localhost ~]# ls -i
33574978 anaconda-ks.cfg 33574997 initial-setup-ks.cfg

有各自的ID账号进行查找;


   目录处理命令

1.mkdir -p(创建一个子目录) 

2

[root@localhost ~]# mkdir /tem/xiaodianying

[root@localhost ~]# mkdir -p  /tem/Japan/boduo     -p(递归创建);

3.[root@localhost ~]# cd /tem  (切换到任意一个文件目录下)

root@localhost tem]# cd /tem /Japan/cangjing

获得当前详细目录:pwd(打印当前文件夹);

4.[root@localhost cangjing]# cd .. (回到上一级目录);

5.rmdir(删除空目录)[root@localhost tem]# rmdir  /tem/Japan/cangjing/tem/Japan/longze

6.cp(copy)  -r  -p

[root@localhost barrylovejune]# cp -r /tem/Japan/cangjing /root/bojie.18+ (复制的同时进行改名字)

7.rm

改名字:

anaconda-ks.cfg boduo bojie.18+ cangjing enscript.cfg initial-setup-ks.cfg nvshen
[root@localhost ~]# cd /root
[root@localhost ~]# mv cangjing canglaoshi
[root@localhost ~]# ls
anaconda-ks.cfg boduo bojie.18+ canglaoshi enscript.cfg initial-setup-ks.cfg nvshen

 

8.rm 删除文件或目录 -rf

 9.pwd  (查看当前的工作路径)


 

1.touch(创建文件)

2.cat(查看) -n(行号)   

([root@localhost tem]# tac /etc/issue 反写cat可以倒置查看)


[root@localhost tem]# cat -n /etc/issue
1 \S
2 Kernel \r on an \m
3

2.more+文件名(查看  按空格或者f一页一页往后翻页,回车是一行一行的)q退出;

3.less 翻页面,page up 向上或者向下翻页面;[root@localhost tem]# less /etc/services     

                                                                           / +关键词进行搜索,按N(标识next);

4.head(看文件的前几行)

[root@localhost tem]# head -n 7 /etc/services   (默认是前十行的)

5.tail(用法同上)

[root@localhost tem]# tail -n 3 /etc/services

 


 

1.ln      (软连接就是快捷方式)      @@@@@@@@@@@@没有弄熟!!!!要回头学习!!!!@@@@@@@@@@@@

[root@localhost tem]# ln -s /etc/issue /tem/issue.soft   软连接以L开头lrwxrwxrwx标识,较小,箭头指向,快捷方式;

lrwxrwxrwx. 1 root root 10 4月 8 17:03 /tem/issue.soft -> /etc/issue

[root@localhost tem]# ln /etc/issue /tem/issue.hard   硬链接     拷贝(cp  -p 可以同步更新)  (硬链接不能跨分区,不能将硬连接指向目录)



权限管理命令

1.chmod

 

posted on 2018-04-08 12:45  马文奇  阅读(201)  评论(0编辑  收藏  举报

导航