linux一些基础文件操作命令

hxd@localhost ~]$ ls
公共  模板  视频  图片  文档  下载  音乐  桌面
[hxd@localhost ~]$ [hxd@localhost ~]$ ls
公共  模板  视频  图片  文档  下载  音乐  桌面
[hxd@localhost ~]$ 
[hxd@localhost ~]$ mkdir Dir1
[hxd@localhost ~]$ mkdir -m 007  Dir2
[hxd@localhost ~]$ mkdir Dir3 Dir4 Dir5
[hxd@localhost ~]$ mkdir -p /Dir1/Dir2/Dir3/Dir4/Dir5
[hxd@localhost ~]$ ls
公共  视频  文档  音乐  Dir1  Dir3  Dir5
模板  图片  下载  桌面  Dir2  Dir4
[hxd@localhost ~]$ ls -a
.     模板  文档  桌面           .bashrc  Dir1  Dir4    .mozilla
..    视频  下载  .bash_logout   .cache   Dir2  Dir5
公共  图片  音乐  .bash_profile  .config  Dir3  .local
[hxd@localhost ~]$ cd Dir1
[hxd@localhost Dir1]$ CD ../Dir1
bash: CD: command not found...
Similar command is: 'cd'
[hxd@localhost Dir1]$ 
[hxd@localhost Dir1]$ cd -
/home/hxd
[hxd@localhost ~]$ 
[hxd@localhost ~]$ cd /
[hxd@localhost /]$ 
[hxd@localhost /]$ cd
[hxd@localhost ~]$ 
[hxd@localhost ~]$ mkdir  6666
[hxd@localhost ~]$ ls
6666  模板  图片  下载  桌面  Dir2  Dir4
公共  视频  文档  音乐  Dir1  Dir3  Dir5
[hxd@localhost ~]$ 
[hxd@localhost ~]$ cd 6666
[hxd@localhost 6666]$ mkdir File1.cfg
[hxd@localhost 6666]$ ls
File1.cfg
[hxd@localhost 6666]$ mv File1.cfg File2.cfg
[hxd@localhost 6666]$ ls
File2.cfg
hxd@localhost 6666]$ ls
Dir1  File2.cfg
[hxd@localhost 6666]$ mv File2.cfg ./Dir1
[hxd@localhost 6666]$ ls
Dir1
[hxd@localhost 6666]$ cd Dir1
[hxd@localhost Dir1]$ ls
File2.cfg
[hxd@localhost Dir1]$ 
[hxd@localhost 6666]$ 
[hxd@localhost 6666]$ ls
Dir1  Dir3
[hxd@localhost 6666]$ mv Dir1 ./Dir3/Dir2
[hxd@localhost 6666]$ ls
Dir3
[hxd@localhost 6666]$ mv -f ./Dir3/* .
[hxd@localhost 6666]$ LS
[hxd@localhost 6666]$ ls
Dir2  Dir3
hxd@localhost ~]$ ls 6666
Dir2  Dir3
[hxd@localhost ~]$ cd 6666
[hxd@localhost 6666]$ rmdir Dir3
[hxd@localhost 6666]$ 
[hxd@localhost Dir3]$ rmdir -p File.cfg
[hxd@localhost Dir3]$ ls
[hxd@localhost 6666]$ tar -cvf Dir2.tar Dir2
Dir2/
Dir2/File2.cfg/
[hxd@localhost 6666]$ tar -xvf Dir2.tar
Dir2/
Dir2/File2.cfg/
[hxd@localhost 6666]$ ls
Dir2  Dir2.tar  Dir3
[hxd@localhost 6666]$ 

  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值