美文网首页
bash技巧

bash技巧

作者: wswenyue | 来源:发表于2014-12-26 21:53 被阅读27次
  • 花括号{}的使用
[root@iterbest temp]# echo {a,b,c}
a b c
[root@iterbest temp]# echo user{1,5,8}
user1 user5 user8
[root@iterbest temp]# echo {0..10}
0 1 2 3 4 5 6 7 8 9 10
[root@iterbest temp]# echo {0..10..2}
0 2 4 6 8 10
[root@iterbest temp]# echo a{2..-1}
a2 a1 a0 a-1
[root@iterbest temp]# ls
passwd
[root@iterbest temp]# mkdir {dir1,dir2,dir3}
[root@iterbest temp]# ls
dir1  dir2  dir3  passwd
[root@iterbest temp]# ls -ld dir{1,2,3}
drwxr-xr-x. 2 root root 4096 Dec 26 21:41 dir1
drwxr-xr-x. 2 root root 4096 Dec 26 21:41 dir2
drwxr-xr-x. 2 root root 4096 Dec 26 21:41 dir3
[root@iterbest temp]# chmod 777 dir{1,2}
[root@iterbest temp]# ls
dir1  dir2  dir3  passwd

相关文章

  • bash技巧

    统计代码行数 获取脚本所在的路径 跨行字符串 正则表达式

  • bash技巧

    花括号{}的使用

  • 简洁的Bash Programming技巧(三)

    简洁的Bash Programming技巧(三) 这一系列的文章专门介绍 Bash 编程中一些简洁的技巧,帮助大家...

  • 简洁的 Bash Programming 技巧

    简洁的 Bash Programming 技巧这一系列文章专门介绍Bash编程中一些简洁的技巧,帮助大家提供 Ba...

  • 简洁的Bash Programming技巧(一)

    简洁的Bash Programming技巧(一) 1. bash中alias的使用 alias其实是给常用的命令定...

  • Bash命令行快捷键与技巧

    Bash命令行快捷键与技巧 引言 Bash默认使用 Emacs 的输入模式,使用 GNU Readline 的Ke...

  • Bash小技巧

    每个程序员,在职业生涯的某个时刻,总会发现自己需要知道一些Linux方面的知识。我并不是说你应该成为一个Linux...

  • 51/70 bash使用技巧

    layout: "post"title: "bash使用技巧"date: "2017-04-19 17:39" 本...

  • BASH使用小技巧

    BASH 运行选项 -x 输出sh运行时的详细步骤 重新设置终端大小 一般情况下终端大小是2480,或者4214...

  • Shell 的基本使用

    这里使用的是Bash 概要语法 小技巧 当前执行shell文件的位置 参考 shell教程

网友评论

      本文标题:bash技巧

      本文链接:https://www.haomeiwen.com/subject/atwatttx.html