Skip to content

Instantly share code, notes, and snippets.

@dotku
Last active February 22, 2017 11:11
Show Gist options
  • Save dotku/194dcf278cb6c5944103 to your computer and use it in GitHub Desktop.
Save dotku/194dcf278cb6c5944103 to your computer and use it in GitHub Desktop.
Linux 相关的内容
  1. 查看版本

     # Finding your kernel release
     $ uname -r
     > 3.16.0-34-generic
     
     # Finding your distribution release
     $ lsb_release -a
     > Distributor ID: Ubuntu  
     > Description:    Ubuntu 14.10  
     > Release:        14.10  
     > Codename:       utopic  
     [!] Amazon Linux 无效  
     
     # Retrive Destribution release file
     $ cat /etc/*release*
     NAME="Amazon Linux AMI"
     VERSION="2015.09"
     ID="amzn"
     ID_LIKE="rhel fedora"
     VERSION_ID="2015.09"
     PRETTY_NAME="Amazon Linux AMI 2015.09"
     ANSI_COLOR="0;33"
     CPE_NAME="cpe:/o:amazon:linux:2015.09:ga"
     HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
     Amazon Linux AMI release 2015.09
     cpe:/o:amazon:linux:2015.09:ga
    
  2. Changing User Passwords

     $ passwd <username>
     # usually, it requires root permission
    
  3. Process Management

https://www.cyberciti.biz/faq/what-process-has-open-linux-port/

Amazon Linux 是基于 CentOS 制作的发行版,与 Ubuntu 上有不少的差异

  1. php.ini 文件的位置 在 Ubuntu 中, php.ini 文件在多个地方存在

     /etc/php5/cli/php.ini is for the CLI PHP program, which you found by running php on the terminal.
     /etc/php5/cgi/php.ini is for the php-cgi system which isn't specifically used in this setup.
     /etc/php5/apache2/php.ini is for the PHP plugin used by Apache. This is the one you need to edit for changes to be applied for your Apache setup.
    

在 Amazon Linux 中,已知的 php.ini 文件位于 /etc/php.ini

  1. yum vs apt-get

在 Amazon Linux 中,使用 yum 来管理安装包,在 Ubuntu 中则使用 apt-get 来管理安装包。

  1. 启动服务

通过 /etc/init.d/httpd restart 这样的方式来启动服务,这里是启动 httpd 服务,在 Ubuntu 下未验证。 同时 Amazon 也支持 Ubuntu 方式的启动服务,比如

    $ service httpd restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment