1.ͨÅä·û
*±íʾ¶à¸ö×Ö·û
£¿µ¥Ò»×Ö·û
[a-z] matches a range of characters;
[^a-z] a-z·¶Î§Ö®ÍâµÄÆ¥Åä
2. historyÃüÁî
Àý£º324 ls
ÏëÖ´ÐÐ324ºÅÃüÁî¿ÉÒÔʹÓà ¡°£¡324
^[ÉÏÒ»ÃüÁîÖеÄ×Ö·û´®]^[ÓÃÀ´Ìæ´úÉÏÒ»×Ö·ûµÄ´®]
È磺ִÐÐÁËping 192.168.0.1Ö®ºó
ÔÙÖ´ÐÐ ^192^172 »Ø³µ£¬Ð§¹ûÊÇping 172.168.0.1
3.~ ±íʾÓû§µÄhomeĿ¼
cd ~½øÈ뵱ȻÓû§µÄhomeĿ¼
cd ~user1 ½øÈëuser1µÄhomeĿ¼
4.±äÁ¿
È磺touch {1,2,3}
¾ÍÊÇ »á´´½¨1¡¢2¡¢3Ŀ¼
Èç¹ûÖ´ÐÐ touch a{1,2,4}
¾Í»á´´½¨ a1,a2,a3Èý¸öĿ¼
Èç¹ûÖ´ÐÐ touch {a,b}{1,2}
¾Í»á´´½¨ a1,a2,b1,b2 ËĸöĿ¼
4.`Ö¸Áî`»òÕß$(Ö¸Áî)·ÅÖ¸Áî
Àý£ºecho "HostName:`hostname`" Óëecho "HostName:$(hostname)"Ч¹ûÏàͬ
½á¹û HostName£ºlocalhost.localdomain
5.±äÁ¿
Àý£ºa=5
echo $a
b=2
echo $b
echo $[$a+$b]
½á¹ûΪ7
ÓÃ\À´×ªÒå$
Èç echo your cost is $5.5
Êä³ö½á¹û£ºyour cost is .5ϵͳ°Ñ$5µ±×÷±äÁ¿ÁË
ʹÓÃecho your cost is \$5.5
Êä³ö½á¹û£ºyour cost is $5.5