FreeTstar

loving Freedom + + loving Linux

  • 首页
  • Archive
  • 关于
  • 杂七杂八
  • 留言板
Twitter Sina RSS

一些积累的CLI Tricks

发布于 2011年01月7日 由 freetstar
18 条评论发表评论

删除文件中的空行

grep . oldfile >newfile
grep -v "^$" oldfile >newfile

压缩字符串里的空格

tr -s " " " " strings

scp小用:
scp也可以在本地机器中当成cp用,如:

cp file1 file2

scp file1 file2
当然scp主要是用户网络传输的

scp tem.pdf username@remotemachine:

注意:“:”,同志们可以想象下没有冒号会怎么样

充分利用alias吧
比如说:cd3 cd4

alias cd3='cd ../..'
alias cd4='cd ../../..'

用组合键对付长命令行

ctrl+a 行首
ctrl+e 行尾
ctrl+u 光标前
ctrl+k 光标后
ESC+.调出上次你的命令所使用的参数
Ctrl+R 搜索

用fc命令将上次执行过的命令放到编辑器中执行
当然也可以用Ctrl+x和Ctrl+e来执行

正用着vim了却想起来某个命令没有执行怎么办

Solution1: 执行:!命令
Solution2: Ctrl+z先挂起来,回来运行玩了命令再玩你

快速的给文件改后缀

rename html htm  *.html
分类:PROGRAM
Redhat4.8配置bond0小记
贴下vimrc和zshrc

18 则回应给 “一些积累的CLI Tricks”

  1. Mucid UNITED STATES Mozilla Firefox Ubuntu Linux 说道:
    2011年01月8日 6:39 下午

    alias果然是与映射分不开,shell里面映射指令,apache里面映射全局路径 :roll:

    [回复]

    freetstar CHINA Google Chrome Linux 回复:
    一月 8th, 2011 at 6:49 下午

    @Mucid, 哈哈,第一反应没明白的你的意思..alias强大

    [回复]

    Mucid UNITED STATES Mozilla Firefox Ubuntu Linux 回复:
    一月 8th, 2011 at 7:21 下午

    @freetstar, 我一向都神昏颠倒的 :roll: :roll:

    [回复]

  2. 婉秋 AUSTRALIA Mozilla Firefox Linux 说道:
    2011年01月7日 11:18 下午

    诶,你那个显示代码用的是啥插件》很不错的样子。
    我的博客ip被墙了,悲

    [回复]

    freetstar CHINA Google Chrome Linux 回复:
    一月 7th, 2011 at 11:21 下午

    @婉秋, syshilight什么的…具体插件名一直没记下来

    现在ip还没恢复吗?我去看看

    [回复]

    freetstar CHINA Google Chrome Linux 回复:
    一月 7th, 2011 at 11:21 下午

    @婉秋, 貌似还真被墙了…

    [回复]

    婉秋 AUSTRALIA Mozilla Firefox Linux 回复:
    一月 7th, 2011 at 11:26 下午

    @freetstar, 实在不行我就要转移了,估计会去Godaddy上找了,不知有什么更好地推荐没有

    [回复]

    Mucid UNITED STATES Mozilla Firefox Ubuntu Linux 回复:
    一月 8th, 2011 at 6:36 下午

    @婉秋, 美女,像哥一样买VPS吧!

    [回复]

    婉秋 AUSTRALIA Mozilla Firefox Windows 回复:
    一月 8th, 2011 at 7:41 下午

    @Mucid, 太贵了……比Godaddy的虚拟主机贵好多

    [回复]

    Mucid UNITED STATES Mozilla Firefox Ubuntu Linux 回复:
    一月 8th, 2011 at 8:00 下午

    @婉秋, 把呢滴那堆computer卖了,换vps。
    貌似我听说么人家里电脑很多啊 :twisted:

    [回复]

    婉秋 AUSTRALIA Mozilla Firefox Linux 回复:
    一月 7th, 2011 at 11:29 下午

    @freetstar, 刚刚看了下godaddy太贵,悲剧了

    [回复]

    freetstar CHINA Google Chrome Linux 回复:
    一月 7th, 2011 at 11:42 下午

    @婉秋, 貌似最近godaddy有优惠码的…
    我去给你找找:gdz138n

    [回复]

    Mucid UNITED STATES Mozilla Firefox Ubuntu Linux 回复:
    一月 8th, 2011 at 6:38 下午

    @freetstar, 其实free哥也杯具,早进入我的autoproxy列表了……

    [回复]

    freetstar CHINA Google Chrome Linux 回复:
    一月 8th, 2011 at 6:50 下午

    @Mucid, 我还是低调路过吧

    [回复]

    Mucid UNITED STATES Mozilla Firefox Ubuntu Linux 回复:
    一月 8th, 2011 at 7:19 下午

    @freetstar, 太低调灰阳痿的 8-O 8-O

    [回复]

    freetstar CHINA Google Chrome Linux 回复:
    一月 8th, 2011 at 7:34 下午

    @Mucid, 其实早已经阳痿了的…

    [回复]

    Mucid UNITED STATES Mozilla Firefox Ubuntu Linux 回复:
    一月 8th, 2011 at 8:00 下午

    @freetstar, 上长沙五洲医院,有两把刷子 :roll:

    freetstar CHINA Google Chrome Linux 回复:
    一月 8th, 2011 at 8:08 下午

    @Mucid, 好yd..

    [回复]

发表评论 取消回复

电子邮件地址不会被公开。 必填项已用 * 标注

*

*


疑问 开心 悲伤 邪恶 惊叹 微笑 脸红 笑 惊讶 惊奇 迷惑 酷 憨笑 生气 阴险 转眼球 眨眼 主意 箭头 中立 哭 大笑

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-spam image

点击取消回复
第 1 页,共 1 页1
  • 欢迎订阅

  • Github

  • 近期评论

    • freetstar CHINA Mozilla Firefox Linux 发表在《留言板》
    • _Fly CHINA Google Chrome Linux 发表在《使用e4rat加速你的linux启动速度(ext4文件系统专用)》
    • walfred Mozilla Firefox Windows 发表在《留言板》
    • freetstar CHINA Mozilla Firefox Windows 发表在《用landslide创建html5 slide》
  • Spread Firefox Affiliate Button
  • 我的豆瓣

  • 链接表

    • 51开源社区
    • Adam's
    • delectate's blog
    • Don's
    • fl
    • ghostunix
    • Jasey Wang
    • Jerry's Blog
    • Moolight@Ericyue
    • OSMSG
    • panda
    • Pity is the Bomp
    • PT ubuntu
    • Tao Zhu
    • ubuntuhome
    • WOW!ubuntu
    • zhangzhfang
    • 丕字的blog
    • 傻东の学习笔记
    • 奶牛的blog
    • 孤风颠影
    • 弯柚博客
    • 熊猫党军委主席
    • 靖 轩
    • 马力哥
    • 黑孩儿
  • 我的支付宝

  • 功能

    • 登录
    • 文章 RSS
    • 评论 RSS
    • WordPress.org
© FreeTstar. WordPress 强力驱动 | Nest Theme by YChong