Bash Tricks
September25
Bash Tricks
list the alphabets ‘A’ to ‘Z’
1 2 | $ 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 |
list the alphabets ‘Z’ to ‘A’
1 2 | $ echo {Z..A} Z Y X W V U T S R Q P O N M L K J I H G F E D C B A |
list the alphabets ‘a’ to ‘z’
1 2 | $ 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 |
list the alphabets ‘z’ to ‘a’
1 2 | $ echo {z..a} z y x w v u t s r q p o n m l k j i h g f e d c b a |
list the numbers 1 to 15
1 2 | $ echo {1..15} 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
Adding number in the back
1 2 | $ echo {1..15}1 11 21 31 41 51 61 71 81 91 101 111 121 131 141 151 |
Adding number in front and back.
1 2 | $ echo 2{1..15}1 211 221 231 241 251 261 271 281 291 2101 2111 2121 2131 2141 2151 |
Apply it for copy command
1 2 3 4 5 | $ cp {A,C}.txt $ ls -lrt [AC].txt -rw-r--r-- 1 kamaraj kamaraj 12 Sep 6 23:08 A.txt -rw-r--r-- 1 kamaraj kamaraj 12 Sep 25 22:52 C.txt |
Recent Comments