linux之.(点)、{}作用

.和…表示位置,即当前目前和父目录
例如ls . -l 及cd . 表示当前目录,实际一般会省略
cd… 进入父目录

**而对于文件前面加.,**表示隐藏该文件

[root@leyshine etc]# touch .test.txt
[root@leyshine etc]# ls -l
total 0
[root@leyshine etc]# ls -al
total 0
drwxr-xr-x.  2 root root  23 Feb  4 16:58 .
drwxr-xr-x. 13 root root 155 Jan 29 22:07 ..
-rw-r--r--.  1 root root   0 Feb  4 16:58 .test.txt
[root@leyshine etc]# cat .test.txt
[root@leyshine etc]# vim .test.txt 
[root@leyshine etc]# stat .test.txt
  File: ‘.test.txt’
  Size: 18        	Blocks: 8          IO Block: 4096   regular file
Device: fd00h/64768d	Inode: 3884300     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Context: unconfined_u:object_r:etc_t:s0
Access: 2020-02-04 16:59:35.797000000 +0800
Modify: 2020-02-04 16:59:35.797000000 +0800
Change: 2020-02-04 16:59:35.801000000 +0800
 Birth: -

关于…和{}的妙用

[root@localhost ~]# echo {1..10}
1 2 3 4 5 6 7 8 9 10
[root@localhost ~]# echo {1..10..3}
1 4 7 10
[root@localhost ~]# echo {1..10..1}
1 2 3 4 5 6 7 8 9 10
[root@localhost ~]# echo {10..3..2}
10 8 6 4
[root@localhost ~]# echo {10..1..2}
10 8 6 4 2
[root@localhost ~]# echo {000..020..2}
000 002 004 006 008 010 012 014 016 018 020
[root@localhost ~]# echo {a..z}
a b c d e f g h i j k l m n o p q r s t u v w x y z
[root@localhost ~]# echo {A..Z}
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
[root@localhost ~]# echo {A..b}
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [  ] ^ _ ` a b
[root@localhost ~]# echo {cat,dog,pig,elephant}
cat dog pig elephant
[root@localhost ~]# echo {cat,dog,pig,elephant}_animal
cat_animal dog_animal pig_animal elephant_animal
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值