个人工具

“UbuntuHelp:SwitchingToUbuntu/FromLinux”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/SwitchingToUbuntu/FromLinux}}
 
{{From|https://help.ubuntu.com/community/SwitchingToUbuntu/FromLinux}}
 
{{Languages|UbuntuHelp:SwitchingToUbuntu/FromLinux}}
 
{{Languages|UbuntuHelp:SwitchingToUbuntu/FromLinux}}
 
 
 
== Switching to Ubuntu from Traditional Unix-like Operating Systems ==
 
== Switching to Ubuntu from Traditional Unix-like Operating Systems ==
 
 
Many people who use Unix-like Operating Systems make the switch to Ubuntu everyday and even more are considering it. This page shows the Ubuntu equivalents of many traditional Unix applications,and tasks.  
 
Many people who use Unix-like Operating Systems make the switch to Ubuntu everyday and even more are considering it. This page shows the Ubuntu equivalents of many traditional Unix applications,and tasks.  
 
 
There are also specialized guides for particular distros:
 
There are also specialized guides for particular distros:
 
[[UbuntuHelp:SwitchingToUbuntu/FromLinux/RedHatEnterpriseLinuxAndFedora|Switching to Ubuntu From Red Hat Enterprise Linux And Fedora]]
 
[[UbuntuHelp:SwitchingToUbuntu/FromLinux/RedHatEnterpriseLinuxAndFedora|Switching to Ubuntu From Red Hat Enterprise Linux And Fedora]]
 
 
Mac OS X users should read [[UbuntuHelp:SwitchingToUbuntu/FromMacOSX|Switching to Ubuntu From Mac OS X]]
 
Mac OS X users should read [[UbuntuHelp:SwitchingToUbuntu/FromMacOSX|Switching to Ubuntu From Mac OS X]]
 
 
== Performing Administrative Tasks ==
 
== Performing Administrative Tasks ==
 
 
Ubuntu handles the root user a little differently to most other Linux distributions in that it has the root account disabled by default. Instead Ubuntu uses the "sudo" program to allow users in the 'admin' group to run particular commands as root. Graphical config tools also prompt for your password using a similar system. This has many advantages:
 
Ubuntu handles the root user a little differently to most other Linux distributions in that it has the root account disabled by default. Instead Ubuntu uses the "sudo" program to allow users in the 'admin' group to run particular commands as root. Graphical config tools also prompt for your password using a similar system. This has many advantages:
 
* You can't do anything really bad to your system unless you use sudo each time.
 
* You can't do anything really bad to your system unless you use sudo each time.
 
* You don't have to remember a root password - '''sudo only needs your own account's password.'''
 
* You don't have to remember a root password - '''sudo only needs your own account's password.'''
 
* sudo remembers for a limited time that you used your password, so you won't have to enter your password every time you use it.
 
* sudo remembers for a limited time that you used your password, so you won't have to enter your password every time you use it.
 
 
At first only the user you create during installation will have access to sudo. To allow additional users to use sudo, add them to the ''admin'' group.
 
At first only the user you create during installation will have access to sudo. To allow additional users to use sudo, add them to the ''admin'' group.
 
 
=== Using Sudo ===
 
=== Using Sudo ===
 
 
Using sudo is easy, to run a command with root privileges just open a terminal and do:
 
Using sudo is easy, to run a command with root privileges just open a terminal and do:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo <command>
 
sudo <command>
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Replace ''<command>'' with whatever command you wish to use. Sudo will then ask for your '''normal user password''', enter it and press enter to run the command.
 
Replace ''<command>'' with whatever command you wish to use. Sudo will then ask for your '''normal user password''', enter it and press enter to run the command.
 
 
Sudo also has a graphical mode, if you try to run a program from the menu system (such as Synaptic) that requires root privileges a dialog box will appear asking you to enter your '''normal user password'''. Enter your user password and click ''Continue'' or press the enter button on your keyboard.
 
Sudo also has a graphical mode, if you try to run a program from the menu system (such as Synaptic) that requires root privileges a dialog box will appear asking you to enter your '''normal user password'''. Enter your user password and click ''Continue'' or press the enter button on your keyboard.
 
 
To run a proper root shell you can do the following:
 
To run a proper root shell you can do the following:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo -i
 
sudo -i
 
</nowiki></pre>
 
</nowiki></pre>
 
 
This will ask for your normal user password, enter it and you will be at the root prompt.  
 
This will ask for your normal user password, enter it and you will be at the root prompt.  
 
 
== Packaging ==
 
== Packaging ==
 
 
=== For Debian Users ===
 
=== For Debian Users ===
 
 
Packages in Ubuntu can be handled the same way as in Debian using apt-get/synaptic/aptitude from the command line, or using the Synaptic or Gnome-app-install graphical installers.  
 
Packages in Ubuntu can be handled the same way as in Debian using apt-get/synaptic/aptitude from the command line, or using the Synaptic or Gnome-app-install graphical installers.  
 
 
Most of the Debian pool is available to Ubuntu users through the extra ''Universe'' and ''Multiverse'' repositories, which are not enabled on a default install (see AddingRepositoriesHowto to enable them). Optionally you can open ''/etc/apt/sources.list'' with your favorite editor and uncomment the relevant lines to enable the extra repositories.  
 
Most of the Debian pool is available to Ubuntu users through the extra ''Universe'' and ''Multiverse'' repositories, which are not enabled on a default install (see AddingRepositoriesHowto to enable them). Optionally you can open ''/etc/apt/sources.list'' with your favorite editor and uncomment the relevant lines to enable the extra repositories.  
 
 
Every six months a snapshot of Debian Unstable is made and Ubuntu is created from that. That said, installing packages made for Debian on your Ubuntu system can often cause problems due to the minor differences and tweaking the Ubuntu developers need to do to make Ubuntu stable - use Ubuntu's ''Universe'' and ''Multiverse'' repositories instead for you extra software needs.
 
Every six months a snapshot of Debian Unstable is made and Ubuntu is created from that. That said, installing packages made for Debian on your Ubuntu system can often cause problems due to the minor differences and tweaking the Ubuntu developers need to do to make Ubuntu stable - use Ubuntu's ''Universe'' and ''Multiverse'' repositories instead for you extra software needs.
 
 
See [[UbuntuHelp:InstallingSoftware|Installing Software]] for information on installing packages.
 
See [[UbuntuHelp:InstallingSoftware|Installing Software]] for information on installing packages.
 
 
 
== Command Line configuration (aliases and inputrc) ==
 
== Command Line configuration (aliases and inputrc) ==
 
 
This section is written for Mandrake/Mandriva users, but probably applies generally.  
 
This section is written for Mandrake/Mandriva users, but probably applies generally.  
 
 
=== Useful Shell aliases ===
 
=== Useful Shell aliases ===
 
 
Mandriva defines the following aliases (in /etc/profile.d/alias.sh), which make the shell faster to use. They could also go in your .bashrc
 
Mandriva defines the following aliases (in /etc/profile.d/alias.sh), which make the shell faster to use. They could also go in your .bashrc
 
 
{|border="1" cellspacing="0"
 
{|border="1" cellspacing="0"
 
|alias ls='ls -F --color=auto'||make ls coloured, and append characters to denote filetype ( eg trailing / on directory names)
 
|alias ls='ls -F --color=auto'||make ls coloured, and append characters to denote filetype ( eg trailing / on directory names)
第87行: 第59行:
 
|alias md='mkdir'||
 
|alias md='mkdir'||
 
|}
 
|}
 
 
The following make cp,rm, and mv interactive by default, so you don't overwrite a file by mistake. Most people think this is useful, but some think it makes one careless, as one might come to rely upon the implicit -i, on some other system which doesn't have it.
 
The following make cp,rm, and mv interactive by default, so you don't overwrite a file by mistake. Most people think this is useful, but some think it makes one careless, as one might come to rely upon the implicit -i, on some other system which doesn't have it.
 
 
{|border="1" cellspacing="0"
 
{|border="1" cellspacing="0"
 
|alias mv='mv -i'
 
|alias mv='mv -i'
第97行: 第67行:
 
|alias cp='cp -i'
 
|alias cp='cp -i'
 
|}
 
|}
 
 
 
=== Tab Completion Enhancements ===
 
=== Tab Completion Enhancements ===
 
 
Mandriva defines the following in /etc/inputrc (it could also go in ~/.inputrc), which makes tab-completion much more pleasant. In Ubuntu/Debian/RedHat, when tab-completion has several possible alternatives, it simply beeps. In Mandriva, it prints the list of options and then repeats the prompt where you were.  Furthermore, the system beep is now rarer, and when it does beep, it's meaningful, rather than annoying.
 
Mandriva defines the following in /etc/inputrc (it could also go in ~/.inputrc), which makes tab-completion much more pleasant. In Ubuntu/Debian/RedHat, when tab-completion has several possible alternatives, it simply beeps. In Mandriva, it prints the list of options and then repeats the prompt where you were.  Furthermore, the system beep is now rarer, and when it does beep, it's meaningful, rather than annoying.
 
 
<pre><nowiki>
 
<pre><nowiki>
 
set show-all-if-ambiguous on
 
set show-all-if-ambiguous on
 
</nowiki></pre>
 
</nowiki></pre>
 
 
== Music, Movies, DVD Playback and Java ==
 
== Music, Movies, DVD Playback and Java ==
 
 
Getting file formats restricted by patents or copyright such as movies and music to play on your Ubuntu system is simple (although not as simple as it could be). See RestrictedFormats. [[UbuntuHelp:Java]] is simple too.
 
Getting file formats restricted by patents or copyright such as movies and music to play on your Ubuntu system is simple (although not as simple as it could be). See RestrictedFormats. [[UbuntuHelp:Java]] is simple too.
 
 
== Environment Variables ==
 
== Environment Variables ==
 
 
See https://wiki.ubuntu.com/environment_variables
 
See https://wiki.ubuntu.com/environment_variables
 
 
== Documentation ==
 
== Documentation ==
 
 
There are a few good resources you can turn to if you need further help with Ubuntu, these include:
 
There are a few good resources you can turn to if you need further help with Ubuntu, these include:
 
 
* http://help.ubuntu.com - The main source of Ubuntu documentation
 
* http://help.ubuntu.com - The main source of Ubuntu documentation
 
* Clicking on the red life preserver on your Gnome desktop
 
* Clicking on the red life preserver on your Gnome desktop

2007年11月30日 (五) 21:38的版本

Switching to Ubuntu from Traditional Unix-like Operating Systems

Many people who use Unix-like Operating Systems make the switch to Ubuntu everyday and even more are considering it. This page shows the Ubuntu equivalents of many traditional Unix applications,and tasks. There are also specialized guides for particular distros: Switching to Ubuntu From Red Hat Enterprise Linux And Fedora Mac OS X users should read Switching to Ubuntu From Mac OS X

Performing Administrative Tasks

Ubuntu handles the root user a little differently to most other Linux distributions in that it has the root account disabled by default. Instead Ubuntu uses the "sudo" program to allow users in the 'admin' group to run particular commands as root. Graphical config tools also prompt for your password using a similar system. This has many advantages:

  • You can't do anything really bad to your system unless you use sudo each time.
  • You don't have to remember a root password - sudo only needs your own account's password.
  • sudo remembers for a limited time that you used your password, so you won't have to enter your password every time you use it.

At first only the user you create during installation will have access to sudo. To allow additional users to use sudo, add them to the admin group.

Using Sudo

Using sudo is easy, to run a command with root privileges just open a terminal and do:

sudo <command>

Replace <command> with whatever command you wish to use. Sudo will then ask for your normal user password, enter it and press enter to run the command. Sudo also has a graphical mode, if you try to run a program from the menu system (such as Synaptic) that requires root privileges a dialog box will appear asking you to enter your normal user password. Enter your user password and click Continue or press the enter button on your keyboard. To run a proper root shell you can do the following:

sudo -i

This will ask for your normal user password, enter it and you will be at the root prompt.

Packaging

For Debian Users

Packages in Ubuntu can be handled the same way as in Debian using apt-get/synaptic/aptitude from the command line, or using the Synaptic or Gnome-app-install graphical installers. Most of the Debian pool is available to Ubuntu users through the extra Universe and Multiverse repositories, which are not enabled on a default install (see AddingRepositoriesHowto to enable them). Optionally you can open /etc/apt/sources.list with your favorite editor and uncomment the relevant lines to enable the extra repositories. Every six months a snapshot of Debian Unstable is made and Ubuntu is created from that. That said, installing packages made for Debian on your Ubuntu system can often cause problems due to the minor differences and tweaking the Ubuntu developers need to do to make Ubuntu stable - use Ubuntu's Universe and Multiverse repositories instead for you extra software needs. See Installing Software for information on installing packages.

Command Line configuration (aliases and inputrc)

This section is written for Mandrake/Mandriva users, but probably applies generally.

Useful Shell aliases

Mandriva defines the following aliases (in /etc/profile.d/alias.sh), which make the shell faster to use. They could also go in your .bashrc

alias ls='ls -F --color=auto' make ls coloured, and append characters to denote filetype ( eg trailing / on directory names)
alias l='ls' short for ls
alias l.='ls -d .*' show only hidden files
alias la='ls -a' list all files
alias ll='ls -l' long format listing
alias lsd='ls -d */' list only directories
alias lx='ls -X' list, order by extension
alias p='cd -' previous directory
alias s='cd ..' short for cd ..
alias cd..='cd ..' allow omission of space in cd ..
alias rd='rmdir'
alias md='mkdir'

The following make cp,rm, and mv interactive by default, so you don't overwrite a file by mistake. Most people think this is useful, but some think it makes one careless, as one might come to rely upon the implicit -i, on some other system which doesn't have it.

alias mv='mv -i'
alias rm='rm -i'
alias cp='cp -i'

Tab Completion Enhancements

Mandriva defines the following in /etc/inputrc (it could also go in ~/.inputrc), which makes tab-completion much more pleasant. In Ubuntu/Debian/RedHat, when tab-completion has several possible alternatives, it simply beeps. In Mandriva, it prints the list of options and then repeats the prompt where you were. Furthermore, the system beep is now rarer, and when it does beep, it's meaningful, rather than annoying.

set show-all-if-ambiguous on

Music, Movies, DVD Playback and Java

Getting file formats restricted by patents or copyright such as movies and music to play on your Ubuntu system is simple (although not as simple as it could be). See RestrictedFormats. UbuntuHelp:Java is simple too.

Environment Variables

See https://wiki.ubuntu.com/environment_variables

Documentation

There are a few good resources you can turn to if you need further help with Ubuntu, these include:

  • http://help.ubuntu.com - The main source of Ubuntu documentation
  • Clicking on the red life preserver on your Gnome desktop
  • Man and info pages on your system
  • Forums, Mailing Lists and IRC (irc.freenode.net - #ubuntu)