有效使用linux的7个好习惯

Posted 7 months ago at 1:09 am. 0 comments

ad 468x60

不用使用root登录,原因:

  1. Well imagine you’re on the trapeze without a safety net,
    frightening isn’t it? Well that’s effectively what you are doing when
    you login as root, you can inadvertently hose your whole system
  2. You are at the risk of running malware. Any program that is started under root mode will automatically be given root privileges
  3. If there is a common security hole that hasn’t been patched yet, you could be totally “pwned”
  4. It’s common Unix convention, never run anything in root
    mode unless absolutely necessary. If a non-admin program asks for root
    access, you should be suspicious

尽量使用 su,sudo,gksu,kdesu

  • Use “sudo” or “su” , and kill the session when your done
  • If you don’t know how to do it in the command line, use “gksu” or “kdesu”. For example, press alt+f2 and type “gksu nautilus“. Close the app as soon as you finish

注意文件命名

  • As a rule of thumb, only use alphanumeric characters, hyphens, periods, and underscores
  • Avoid special symbols like dollar signs, brackets, and
    percentages. These symbols have special meanings to the shell, and
    could cause conflicts
  • Avoid using spaces, handling files with spaces in the
    terminal is kind of awkward. Replace spaces with either hyphens or
    underscores

把 /home 放在不同的分区

杀死崩溃进程

  1. I have the “force quit” applet on my taskbar, if any app
    starts to act up just click on the “force quit” icon and then kill the
    app
  2. If that doesn’t work, draw up a terminal and type “ps -A” , and take note of the Process ID (PID) of the culprit app, then kill it. “kill PID”
  3. Use the “killall” command, for example, “killall firefox-bin”
  4. If your whole GUI is frozen, and drawing up a terminal is
    impossible, then press CTRL-ALT-F1, this will take you to another
    terminal, and virtually a whole new session. From there kill the
    culprit app using step 2 and 3.
  5. If that doesn’t work, you might want to restart your GUI
    using the CTRL-ALT-Backspace combo. Beware, that this will kill all
    your GUI apps currently running
  6. Invoke CTRL-ALT-F1 and do CTRL+ALT+DEL from here. This
    will not instantly reset your system, merely perform a standard reboot,
    it’s safe. (Assuming you want to restart and CTLR-ALT-F1 works)
  7. Finally if nothing works, don’t rush to the hard reset button, try to Raise a Skinny Elephant

体验不同的发行版

via http://hehe2.net/linux-general/the-7-habits-of-highly-effective-linux-users/

Popularity: 19% [?]

No tag for this post.
ad 468x60

Related posts

No Replies

Feel free to leave a reply using the form below!


Leave a Reply