Archive for the 'Linux' Category

Linux下如何拷贝整个目录下的所有文件

如何在下拷贝一个目录呢?这好像是再如意不过的问题了。
比如要把/home/usera拷贝到/mnt/temp,我首先想到的就是

cp -R /home/usera/* /mnt/temp

但是这样有一个问题,/home/usera下的隐藏文件都不会被拷贝,子目录下的隐藏文件倒是会的。

那如何才是正确的方法呢?有人说用-a选项,有人说用find加管道。
其实没这么复杂,Google了之后,学了一招。原来只有用“.”当前目录代替“*”就好了。

cp -R /home/usera/. /mnt/temp

Posted on 3rd February 2010
Under: Linux | No Comments »

cheat & ztd

cheat sheets 是个不错的网站,在通过gem在命令行下能显示常见工具的cheat sheet。下面是的sheet的输出结果。


$cheat
:
  Zen Things Done ()
  aka "Minimal : The Simplest System Possible"
  For more info see
  http://zenhabits.net/2007/04/minimal--the-simplest-system-possible/
  
  The Four Habits
  ————-
  1. Collect
    * Write down any tasks, ideas, projects, or other information that pop into
    your head.
    * Get it out of your head and onto paper.
  
  2. Process
   * Make quick decisions on things in your inbox, do not put them off.
   * Do it!, Trash it, Delegate it, it (someday/maybe), calendar for later
  
  3. Plan
    *  Each day, create a list of 1-3 Most Important Tasks (your Big Rocks for
    the day) and be sure to accomplish them.
    * Do your MITs early in the day to get them out of the way and enjoy the
    rest of the day.
  
  4. Do
    * One task at a time, without distractions.
    * This is one of the most important habits in : Select a task (preferably
    one of your MITs) and focus on it to the exclusion of all else.
  • install cheat in debiean/squeeze
    • apt-get install rubygems
    • ln -s /usr/bin/ruby1.8 /usr/bin/ruby
    • gem install cheat
    • ln -s /var/lib/gems/1.8/gems/cheat-1.2.1/bin/cheat /usr/bin/cheat

Posted on 29th October 2009
Under: GTD & ZTD, Linux | No Comments »