赞
踩
.和…表示位置,即当前目前和父目录
例如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
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。