1 Star 1 Fork 0

R&T / ehlxr

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.html 36.10 KB
一键复制 编辑 原始数据 按行查看 历史
R&T 提交于 2017-02-06 16:11 . 站点更新: 2017-02-06 16:11:02
<!doctype html><html class="theme-next pisces use-motion" lang="zh-Hans"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"><meta http-equiv="Cache-Control" content="no-transform"><meta http-equiv="Cache-Control" content="no-siteapp"><link href="//cdn.jsdelivr.net/fancybox/2.1.5/jquery.fancybox.min.css" rel="stylesheet" type="text/css"><link href="//fonts.googleapis.com/css?family=Roboto:300,300italic,400,400italic,700,700italic|Damion:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css"><link href="//maxcdn.bootstrapcdn.com/font-awesome/4.6.2/css/font-awesome.min.css" rel="stylesheet" type="text/css"><link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css"><meta name="keywords" content="ehlxr,elvin,henry,Java,一个程序猿之家,小桥流水人家"><link rel="alternate" href="/atom.xml" title="Ehlxr's Blog" type="application/atom+xml"><link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0"><meta name="description" content="Happiness is a way station between too much and too little."><meta property="og:type" content="website"><meta property="og:title" content="Ehlxr's Blog"><meta property="og:url" content="http://ehlxr.me/index.html"><meta property="og:site_name" content="Ehlxr's Blog"><meta property="og:description" content="Happiness is a way station between too much and too little."><meta name="twitter:card" content="summary"><meta name="twitter:title" content="Ehlxr's Blog"><meta name="twitter:description" content="Happiness is a way station between too much and too little."><script type="text/javascript" id="hexo.configurations">var NexT=window.NexT||{},CONFIG={root:"/",scheme:"Pisces",sidebar:{position:"left",display:"hide"},fancybox:!0,motion:!0,duoshuo:{userId:"11236435",author:"Author"},algolia:{applicationID:"",apiKey:"",indexName:"",hits:{per_page:10},labels:{input_placeholder:"Search for Posts",hits_empty:"We didn't find any results for the search: ${query}",hits_stats:"${hits} results found in ${time} ms"}}}</script><link rel="canonical" href="http://ehlxr.me/"><title> Ehlxr's Blog</title></head><body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans"><script type="text/javascript">var _hmt=_hmt||[];!function(){var e=document.createElement("script");e.src="https://hm.baidu.com/hm.js?87cca473dad9b86bb9431831d3a4cd7e";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}()</script><div class="container one-collumn sidebar-position-left page-home"><div class="headband"></div><header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="header-inner"><div class="site-meta custom-logo"><div class="custom-logo-site-title"><a href="/" class="brand" rel="start"><span class="logo-line-before"><i></i></span> <span class="site-title">Ehlxr's Blog</span><span class="logo-line-after"><i></i></span></a></div><h1 class="site-subtitle" itemprop="description">世界那么大,在此安个家...</h1></div><div class="site-nav-toggle"> <button><span class="btn-bar"></span><span class="btn-bar"></span><span class="btn-bar"></span></button></div><nav class="site-nav"><ul id="menu" class="menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="menu-item-icon fa fa-fw fa-home"></i><br> 首页</a></li><li class="menu-item menu-item-archives"><a href="/archives" rel="section"><i class="menu-item-icon fa fa-fw fa-archive"></i><br> 归档</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="menu-item-icon fa fa-fw fa-th"></i><br> 分类</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="menu-item-icon fa fa-fw fa-tags"></i><br> 标签</a></li><li class="menu-item menu-item-picture"><a href="/picture" rel="section"><i class="menu-item-icon fa fa-fw fa-image"></i><br> 图册</a></li><li class="menu-item menu-item-about"><a href="/about" rel="section"><i class="menu-item-icon fa fa-fw fa-user"></i><br> 关于</a></li><li class="menu-item menu-item-search"><a href="javascript:;" class="popup-trigger"><i class="menu-item-icon fa fa-search fa-fw"></i><br> 搜索</a></li></ul><div class="site-search"><div class="popup"><span class="search-icon fa fa-search"></span> <input type="text" id="local-search-input"><div id="local-search-result"></div> <span class="popup-btn-close">close</span></div></div></nav></div></header><main id="main" class="main"><div class="main-inner"><div class="content-wrap"><div id="content" class="content"><section id="posts" class="posts-expand"><article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"><link itemprop="mainEntityOfPage" href="http://ehlxr.me/2017/01/18/Linux-的-nohup-命令的用法/"><span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person"><meta itemprop="name" content="小桥流水人家"><meta itemprop="description" content=""><meta itemprop="image" content="http://oapjp6spr.bkt.clouddn.com/eh3.png"></span><span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><meta itemprop="name" content="Ehlxr's Blog"> <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject"><img style="display:none" itemprop="url image" alt="Ehlxr's Blog" src="http://oapjp6spr.bkt.clouddn.com/logo.jpg"></span></span><header class="post-header"><h2 class="post-title" itemprop="name headline"> <a class="post-title-link" href="/2017/01/18/Linux-的-nohup-命令的用法/" itemprop="url">Linux 的 nohup 命令的用法</a></h2><div class="post-meta"><span class="post-time"><span class="post-meta-item-icon"><i class="fa fa-calendar-o"></i></span> <span class="post-meta-item-text">发表于</span> <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-01-18T16:13:21+08:00">2017-01-18</time></span> <span class="post-category"><span class="post-meta-divider">|</span><span class="post-meta-item-icon"><i class="fa fa-folder-o"></i></span> <span class="post-meta-item-text">分类于</span> <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a></span></span> <span class="post-comments-count"><span class="post-meta-divider">|</span><span class="post-meta-item-icon"><i class="fa fa-comment-o"></i></span><a href="/2017/01/18/Linux-的-nohup-命令的用法/#comments" itemprop="discussionUrl"><span class="post-comments-count ds-thread-count" data-thread-key="2017/01/18/Linux-的-nohup-命令的用法/" itemprop="commentCount"></span></a></span> <span id="/2017/01/18/Linux-的-nohup-命令的用法/" class="leancloud_visitors" data-flag-title="Linux 的 nohup 命令的用法"><span class="post-meta-divider">|</span><span class="post-meta-item-icon"><i class="fa fa-eye"></i></span> <span class="post-meta-item-text">阅读次数</span><span class="leancloud-visitors-count"></span></span></div></header><div class="post-body" itemprop="articleBody"><blockquote><p>如果你正在运行一个进程,而且你觉得在退出帐户时该进程还不会结束,那么可以使用 <code>nohup</code> 命令。</p></blockquote><h1 id="命令简介"><a href="#命令简介" class="headerlink" title="命令简介"></a>命令简介</h1><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ nohup Command [ Arg … ] [ &amp; ]</div></pre></td></tr></table></figure><p>该命令可以在你退出帐户/关闭终端之后继续运行相应的进程。<code>nohup</code> 就是不挂起的意思(<code>no hang up</code>)。</p><p><code>nohup</code> 运行由 <code>Command</code> 和相关的 <code>Arg</code> 参数指定的命令,忽略所有挂断(<code>SIGHUP</code>)信号。要运行后台中的 <code>nohup</code> 命令,添加 <code>&amp;</code> ( 表示 <code>and</code> 的符号)到命令的尾部。</p><p>如果使用 <code>nohup</code> 命令提交作业,那么在缺省情况下该作业的所有输出都被重定向到一个名为 <code>nohup.out</code> 的文件中,除非另外指定了输出文件。</p><div class="post-button text-center"> <a class="btn" href="/2017/01/18/Linux-的-nohup-命令的用法/#more" rel="contents">阅读全文 &raquo;</a></div></div><div></div><div></div><footer class="post-footer"><div class="post-eof"></div></footer></article><article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"><link itemprop="mainEntityOfPage" href="http://ehlxr.me/2017/01/18/Linux-中-fg、bg、jobs、-指令/"><span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person"><meta itemprop="name" content="小桥流水人家"><meta itemprop="description" content=""><meta itemprop="image" content="http://oapjp6spr.bkt.clouddn.com/eh3.png"></span><span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><meta itemprop="name" content="Ehlxr's Blog"> <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject"><img style="display:none" itemprop="url image" alt="Ehlxr's Blog" src="http://oapjp6spr.bkt.clouddn.com/logo.jpg"></span></span><header class="post-header"><h2 class="post-title" itemprop="name headline"> <a class="post-title-link" href="/2017/01/18/Linux-中-fg、bg、jobs、-指令/" itemprop="url">Linux 中 fg、bg、jobs、& 指令</a></h2><div class="post-meta"><span class="post-time"><span class="post-meta-item-icon"><i class="fa fa-calendar-o"></i></span> <span class="post-meta-item-text">发表于</span> <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-01-18T15:30:16+08:00">2017-01-18</time></span> <span class="post-category"><span class="post-meta-divider">|</span><span class="post-meta-item-icon"><i class="fa fa-folder-o"></i></span> <span class="post-meta-item-text">分类于</span> <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a></span></span> <span class="post-comments-count"><span class="post-meta-divider">|</span><span class="post-meta-item-icon"><i class="fa fa-comment-o"></i></span><a href="/2017/01/18/Linux-中-fg、bg、jobs、-指令/#comments" itemprop="discussionUrl"><span class="post-comments-count ds-thread-count" data-thread-key="2017/01/18/Linux-中-fg、bg、jobs、-指令/" itemprop="commentCount"></span></a></span> <span id="/2017/01/18/Linux-中-fg、bg、jobs、-指令/" class="leancloud_visitors" data-flag-title="Linux 中 fg、bg、jobs、& 指令"><span class="post-meta-divider">|</span><span class="post-meta-item-icon"><i class="fa fa-eye"></i></span> <span class="post-meta-item-text">阅读次数</span><span class="leancloud-visitors-count"></span></span></div></header><div class="post-body" itemprop="articleBody"><blockquote><p>记录总结一下 <code>Linux</code><code>fg</code><code>bg</code><code>jobs</code><code>&amp;</code><code>ctrl + z</code> 等相关指令对任务进程的操作。</p></blockquote><h1 id="一、基本用法"><a href="#一、基本用法" class="headerlink" title="一、基本用法"></a>一、基本用法</h1><h2 id="1-1-amp-和-jobs-指令"><a href="#1-1-amp-和-jobs-指令" class="headerlink" title="1.1 &amp; 和 jobs 指令"></a>1.1 <code>&amp;</code><code>jobs</code> 指令</h2><p><code>&amp;</code> 用在一个命令的最后,可以把这个命令转换为后台运行的任务进程。</p><p><code>jobs</code> 查看当前终端有多少在后台运行的进程。</p><ul><li><p><code>jobs</code> 命令执行的结果,<code></code> 表示是一个当前的作业,<code>-</code> 减号表示是一个当前作业之后的一个作业。</p></li><li><p><code>jobs -l</code> 选项可显示所有任务的进程号 <code>pid</code></p></li><li><p><code>jobs</code> 的状态可以是 <code>running</code><code>stopped</code><code>terminated</code>。但是如果任务进程被终止了(<code>kill</code>),当前的终端环境中也就删除了任务的进程标识;也就是说 <strong>jobs 命令显示的是当前 shell 环境中后台正在运行或者被挂起的任务进程信息</strong></p></li></ul><div class="post-button text-center"> <a class="btn" href="/2017/01/18/Linux-中-fg、bg、jobs、-指令/#more" rel="contents">阅读全文 &raquo;</a></div></div><div></div><div></div><footer class="post-footer"><div class="post-eof"></div></footer></article><article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"><link itemprop="mainEntityOfPage" href="http://ehlxr.me/2017/01/10/转-CentOS-升级-kernel/"><span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person"><meta itemprop="name" content="小桥流水人家"><meta itemprop="description" content=""><meta itemprop="image" content="http://oapjp6spr.bkt.clouddn.com/eh3.png"></span><span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><meta itemprop="name" content="Ehlxr's Blog"> <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject"><img style="display:none" itemprop="url image" alt="Ehlxr's Blog" src="http://oapjp6spr.bkt.clouddn.com/logo.jpg"></span></span><header class="post-header"><h2 class="post-title" itemprop="name headline"> <a class="post-title-link" href="/2017/01/10/转-CentOS-升级-kernel/" itemprop="url">[转]CentOS 升级 kernel</a></h2><div class="post-meta"><span class="post-time"><span class="post-meta-item-icon"><i class="fa fa-calendar-o"></i></span> <span class="post-meta-item-text">发表于</span> <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-01-10T11:01:09+08:00">2017-01-10</time></span> <span class="post-category"><span class="post-meta-divider">|</span><span class="post-meta-item-icon"><i class="fa fa-folder-o"></i></span> <span class="post-meta-item-text">分类于</span> <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a></span></span> <span class="post-comments-count"><span class="post-meta-divider">|</span><span class="post-meta-item-icon"><i class="fa fa-comment-o"></i></span><a href="/2017/01/10/转-CentOS-升级-kernel/#comments" itemprop="discussionUrl"><span class="post-comments-count ds-thread-count" data-thread-key="2017/01/10/转-CentOS-升级-kernel/" itemprop="commentCount"></span></a></span> <span id="/2017/01/10/转-CentOS-升级-kernel/" class="leancloud_visitors" data-flag-title="[转]CentOS 升级 kernel"><span class="post-meta-divider">|</span><span class="post-meta-item-icon"><i class="fa fa-eye"></i></span> <span class="post-meta-item-text">阅读次数</span><span class="leancloud-visitors-count"></span></span></div></header><div class="post-body" itemprop="articleBody"><h1 id="一、手动档"><a href="#一、手动档" class="headerlink" title="一、手动档"></a>一、手动档</h1><p>手动档就是从源码开始编译内核安装,好处是可以自己选择任意版本的内核,缺点就是耗时长,编译安装消耗系统资源</p><h2 id="1-1、获取-kernel-源码"><a href="#1-1、获取-kernel-源码" class="headerlink" title="1.1、获取 kernel 源码"></a>1.1、获取 kernel 源码</h2><p>这世界上最伟大的 Linux 内核源码下载地址是 <a href="https://kernel.org/">kernel</a> 官网,选择一个稳定版本下载即可</p><h2 id="1-2、解压并清理"><a href="#1-2、解压并清理" class="headerlink" title="1.2、解压并清理"></a>1.2、解压并清理</h2><p>官方要求将其解压到 <code>/usr/src</code> 目录,其实在哪都可以,为了规范一点索性也解压到此位置,然后为了防止编译残留先做一次清理动作</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line"><span class="comment"># 下载内核源码</span></div><div class="line">$ wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.8.6.tar.xz</div><div class="line"></div><div class="line"><span class="comment"># 解压并移动到 /usr/src</span></div><div class="line">$ tar -Jxvf linux-4.8.6.tar.xz</div><div class="line">$ mv linux-4.8.6 /usr/src/kernels</div><div class="line"></div><div class="line"><span class="comment"># 执行清理(没 gcc 的要装一下)</span></div><div class="line">$ <span class="built_in">cd</span> /usr/src/kernels/linux-4.8.6</div><div class="line">$ make mrproper &amp;&amp; make clean</div></pre></td></tr></table></figure><div class="post-button text-center"> <a class="btn" href="/2017/01/10/转-CentOS-升级-kernel/#more" rel="contents">阅读全文 &raquo;</a></div></div><div></div><div></div><footer class="post-footer"><div class="post-eof"></div></footer></article><article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"><link itemprop="mainEntityOfPage" href="http://ehlxr.me/2017/01/09/Docker-利用数据卷容器来备份、恢复、迁移数据/"><span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person"><meta itemprop="name" content="小桥流水人家"><meta itemprop="description" content=""><meta itemprop="image" content="http://oapjp6spr.bkt.clouddn.com/eh3.png"></span><span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><meta itemprop="name" content="Ehlxr's Blog"> <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject"><img style="display:none" itemprop="url image" alt="Ehlxr's Blog" src="http://oapjp6spr.bkt.clouddn.com/logo.jpg"></span></span><header class="post-header"><h2 class="post-title" itemprop="name headline"> <a class="post-title-link" href="/2017/01/09/Docker-利用数据卷容器来备份、恢复、迁移数据/" itemprop="url">Docker 利用数据卷容器来备份、恢复、迁移数据</a></h2><div class="post-meta"><span class="post-time"><span class="post-meta-item-icon"><i class="fa fa-calendar-o"></i></span> <span class="post-meta-item-text">发表于</span> <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-01-09T16:54:24+08:00">2017-01-09</time></span> <span class="post-category"><span class="post-meta-divider">|</span><span class="post-meta-item-icon"><i class="fa fa-folder-o"></i></span> <span class="post-meta-item-text">分类于</span> <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/Docker/" itemprop="url" rel="index"><span itemprop="name">Docker</span></a></span></span> <span class="post-comments-count"><span class="post-meta-divider">|</span><span class="post-meta-item-icon"><i class="fa fa-comment-o"></i></span><a href="/2017/01/09/Docker-利用数据卷容器来备份、恢复、迁移数据/#comments" itemprop="discussionUrl"><span class="post-comments-count ds-thread-count" data-thread-key="2017/01/09/Docker-利用数据卷容器来备份、恢复、迁移数据/" itemprop="commentCount"></span></a></span> <span id="/2017/01/09/Docker-利用数据卷容器来备份、恢复、迁移数据/" class="leancloud_visitors" data-flag-title="Docker 利用数据卷容器来备份、恢复、迁移数据"><span class="post-meta-divider">|</span><span class="post-meta-item-icon"><i class="fa fa-eye"></i></span> <span class="post-meta-item-text">阅读次数</span><span class="leancloud-visitors-count"></span></span></div></header><div class="post-body" itemprop="articleBody"><blockquote><p>在 Docker 容器之间如果需要共享数据,可以创建一个数据卷容器来实现,并且可以方便的通过数据卷容器来备份、恢复、迁移数据。</p></blockquote><h1 id="创建数据卷容器"><a href="#创建数据卷容器" class="headerlink" title="创建数据卷容器"></a>创建数据卷容器</h1><p>创建一个名为:dbdata 的数据卷容器;设置挂载点为 <code>/vdata</code></p><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ sudo docker run <span class="_">-d</span> -v /vdata --name dbdata alpine sh</div></pre></td></tr></table></figure><p>数据卷容器是一个普通的 Docker 容器,可以不需要启动。<br></p><div class="post-button text-center"> <a class="btn" href="/2017/01/09/Docker-利用数据卷容器来备份、恢复、迁移数据/#more" rel="contents">阅读全文 &raquo;</a></div></div><div></div><div></div><footer class="post-footer"><div class="post-eof"></div></footer></article><article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"><link itemprop="mainEntityOfPage" href="http://ehlxr.me/2017/01/07/CentOS-7-安装-Python3、pip3/"><span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person"><meta itemprop="name" content="小桥流水人家"><meta itemprop="description" content=""><meta itemprop="image" content="http://oapjp6spr.bkt.clouddn.com/eh3.png"></span><span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><meta itemprop="name" content="Ehlxr's Blog"> <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject"><img style="display:none" itemprop="url image" alt="Ehlxr's Blog" src="http://oapjp6spr.bkt.clouddn.com/logo.jpg"></span></span><header class="post-header"><h2 class="post-title" itemprop="name headline"> <a class="post-title-link" href="/2017/01/07/CentOS-7-安装-Python3、pip3/" itemprop="url">CentOS 7 安装Python3、pip3</a></h2><div class="post-meta"><span class="post-time"><span class="post-meta-item-icon"><i class="fa fa-calendar-o"></i></span> <span class="post-meta-item-text">发表于</span> <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-01-07T19:23:22+08:00">2017-01-07</time></span> <span class="post-category"><span class="post-meta-divider">|</span><span class="post-meta-item-icon"><i class="fa fa-folder-o"></i></span> <span class="post-meta-item-text">分类于</span> <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a></span></span> <span class="post-comments-count"><span class="post-meta-divider">|</span><span class="post-meta-item-icon"><i class="fa fa-comment-o"></i></span><a href="/2017/01/07/CentOS-7-安装-Python3、pip3/#comments" itemprop="discussionUrl"><span class="post-comments-count ds-thread-count" data-thread-key="2017/01/07/CentOS-7-安装-Python3、pip3/" itemprop="commentCount"></span></a></span> <span id="/2017/01/07/CentOS-7-安装-Python3、pip3/" class="leancloud_visitors" data-flag-title="CentOS 7 安装Python3、pip3"><span class="post-meta-divider">|</span><span class="post-meta-item-icon"><i class="fa fa-eye"></i></span> <span class="post-meta-item-text">阅读次数</span><span class="leancloud-visitors-count"></span></span></div></header><div class="post-body" itemprop="articleBody"><p>CentOS 7 默认安装了 Python 2,当需要使用 Python 3 的时候,可以手动下载 Python 源码后编译安装。</p><h1 id="一、安装-Python-3"><a href="#一、安装-Python-3" class="headerlink" title="一、安装 Python 3"></a>一、安装 Python 3</h1><h2 id="1-1-安装准备"><a href="#1-1-安装准备" class="headerlink" title="1.1 安装准备"></a>1.1 安装准备</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div></pre></td><td class="code"><pre><div class="line">$ sudo mkdir /usr/<span class="built_in">local</span>/python3 <span class="comment"># 创建安装目录</span></div><div class="line"></div><div class="line"><span class="comment"># 下载 Python 源文件</span></div><div class="line">$ wget --no-check-certificate https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz</div><div class="line"><span class="comment"># 注意:wget获取https的时候要加上:--no-check-certificate</span></div><div class="line"></div><div class="line">$ tar -xzvf Python-3.6.0.tgz <span class="comment"># 解压缩包</span></div><div class="line"></div><div class="line">$ <span class="built_in">cd</span> Python-3.6.0 <span class="comment"># 进入解压目录</span></div></pre></td></tr></table></figure><div class="post-button text-center"> <a class="btn" href="/2017/01/07/CentOS-7-安装-Python3、pip3/#more" rel="contents">阅读全文 &raquo;</a></div></div><div></div><div></div><footer class="post-footer"><div class="post-eof"></div></footer></article></section><nav class="pagination"> <span class="page-number current">1</span><a class="page-number" href="/page/2/">2</a><span class="space">&hellip;</span><a class="page-number" href="/page/9/">9</a><a class="extend next" rel="next" href="/page/2/"><i class="fa fa-angle-right"></i></a></nav></div></div><div class="sidebar-toggle"><div class="sidebar-toggle-line-wrap"><span class="sidebar-toggle-line sidebar-toggle-line-first"></span><span class="sidebar-toggle-line sidebar-toggle-line-middle"></span><span class="sidebar-toggle-line sidebar-toggle-line-last"></span></div></div><aside id="sidebar" class="sidebar"><div class="sidebar-inner"><section class="site-overview sidebar-panel sidebar-panel-active"><div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" src="http://oapjp6spr.bkt.clouddn.com/eh3.png" alt="小桥流水人家"><p class="site-author-name" itemprop="name">小桥流水人家</p><p class="site-description motion-element" itemprop="description">Happiness is a way station between too much and too little.</p></div><nav class="site-state motion-element"><div class="site-state-item site-state-posts"> <a href="/archives"><span class="site-state-item-count">45</span> <span class="site-state-item-name">日志</span></a></div><div class="site-state-item site-state-categories"> <a href="/categories/"><span class="site-state-item-count">10</span> <span class="site-state-item-name">分类</span></a></div><div class="site-state-item site-state-tags"> <a href="/tags/"><span class="site-state-item-count">38</span> <span class="site-state-item-name">标签</span></a></div></nav><div class="feed-link motion-element"><a href="/atom.xml" rel="alternate"><i class="fa fa-rss"></i> RSS</a></div><div class="links-of-author motion-element"><span class="links-of-author-item"><a href="https://github.com/ehlxr" target="_blank" title="GitHub"><i class="fa fa-fw fa-github"></i> GitHub</a></span><span class="links-of-author-item"><a href="http://git.oschina.net/ehlxr" target="_blank" title="Git@OSC"><i class="fa fa-fw fa-globe"></i> Git@OSC</a></span><span class="links-of-author-item"><a href="http://weibo.com/lxr316" target="_blank" title="Weibo"><i class="fa fa-fw fa-weibo"></i> Weibo</a></span><span class="links-of-author-item"><a href="https://twitter.com/ehlxr" target="_blank" title="Twitter"><i class="fa fa-fw fa-twitter"></i> Twitter</a></span><span class="links-of-author-item"><a href="https://www.facebook.com/ehlxr" target="_blank" title="Facebook"><i class="fa fa-fw fa-facebook"></i> Facebook</a></span><span class="links-of-author-item"><a href="https://www.instagram.com/ehlxr" target="_blank" title="instagram"><i class="fa fa-fw fa-instagram"></i> instagram</a></span></div><div class="cc-license motion-element" itemprop="license"> <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" target="_blank"><img src="/images/cc-by-nc-sa.svg" alt="Creative Commons"></a></div><div class="links-of-blogroll motion-element links-of-blogroll-inline"><div class="links-of-blogroll-title"><i class="fa fa-fw fa-globe"></i> Links</div><ul class="links-of-blogroll-list"><li class="links-of-blogroll-item"> <a href="http://ehlxr.top/" title="Home Page" target="_blank">Home Page</a></li><li class="links-of-blogroll-item"> <a href="http://about.me/ehlxr/" title="About me" target="_blank">About me</a></li><li class="links-of-blogroll-item"> <a href="http://notes.ehlxr.top/" title="Ehlxr's Notes" target="_blank">Ehlxr's Notes</a></li><li class="links-of-blogroll-item"> <a href="http://zcheng.ren/" title="ZeeCoder" target="_blank">ZeeCoder</a></li><li class="links-of-blogroll-item"> <a href="http://www.iamlj.com/" title="Jing's Blog" target="_blank">Jing's Blog</a></li><li class="links-of-blogroll-item"> <a href="http://blog.ynxiu.com/" title="AiXiu Blog" target="_blank">AiXiu Blog</a></li><li class="links-of-blogroll-item"> <a href="http://blog.mapan.win/" title="不思凡" target="_blank">不思凡</a></li><li class="links-of-blogroll-item"> <a href="http://wiliam.me/" title="Wiliam's Blog" target="_blank">Wiliam's Blog</a></li><li class="links-of-blogroll-item"> <a href="http://leeyom.top/" title="leeyom" target="_blank">leeyom</a></li><li class="links-of-blogroll-item"> <a href="http://hippo-jessy.com" title="hippo" target="_blank">hippo</a></li></ul></div></section></div></aside></div></main><footer id="footer" class="footer"><div class="footer-inner"><div class="copyright"> &copy; 2016 - <span itemprop="copyrightYear">2017</span><span class="with-love"><i class="fa fa-anchor"></i></span> <span class="author" itemprop="copyrightHolder">小桥流水人家</span></div><div class="powered-by"><a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动</div><div class="theme-info"> 主题 - <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">NexT.Pisces</a></div><div class="busuanzi-count"><script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script><span class="site-uv"><i class="fa fa-user"></i><span class="busuanzi-value" id="busuanzi_value_site_uv"></span></span><span class="site-pv"><i class="fa fa-eye"></i><span class="busuanzi-value" id="busuanzi_value_site_pv"></span></span></div></div></footer><div class="back-to-top"><i class="fa fa-arrow-up"></i></div></div><script type="text/javascript">"[object Function]"!==Object.prototype.toString.call(window.Promise)&&(window.Promise=null)</script><script type="text/javascript" src="//cdn.jsdelivr.net/jquery/2.1.3/jquery.min.js"></script><script type="text/javascript" src="//cdn.jsdelivr.net/fastclick/1.0.6/fastclick.min.js"></script><script type="text/javascript" src="//cdn.jsdelivr.net/jquery.lazyload/1.9.3/jquery.lazyload.min.js"></script><script type="text/javascript" src="//cdn.jsdelivr.net/velocity/1.2.3/velocity.min.js"></script><script type="text/javascript" src="//cdn.jsdelivr.net/velocity/1.2.3/velocity.ui.min.js"></script><script type="text/javascript" src="//cdn.jsdelivr.net/fancybox/2.1.5/jquery.fancybox.pack.js"></script><script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script><script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script><script type="text/javascript" src="/js/src/affix.js?v=5.1.0"></script><script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.0"></script><script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script><script type="text/javascript">var duoshuoQuery={short_name:"eh3"};!function(){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.id="duoshuo-script",t.src=("https:"==document.location.protocol?"https:":"http:")+"//static.duoshuo.com/embed.js",t.charset="UTF-8",(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(t)}()</script><script src="//cdn.jsdelivr.net/ua-parser.js/0.7.10/ua-parser.min.js"></script><script src="/js/src/hook-duoshuo.js?v=5.1.0"></script><script src="//cdn.jsdelivr.net/ua-parser.js/0.7.10/ua-parser.min.js"></script><script src="/js/src/hook-duoshuo.js"></script><script type="text/javascript">function proceedsearch(){$("body").append('<div class="popoverlay">').css("overflow","hidden"),$(".popup").toggle()}var isfetched=!1,search_path="search.xml";0==search_path.length&&(search_path="search.xml");var path="/"+search_path,searchFunc=function(e,t,a){"use strict";$.ajax({url:e,dataType:"xml",async:!0,success:function(e){isfetched=!0,$(".popup").detach().appendTo(".header-inner");var r=$("entry",e).map(function(){return{title:$("title",this).text(),content:$("content",this).text(),url:$("url",this).text()}}).get(),c=document.getElementById(t),n=document.getElementById(a);c.addEventListener("input",function(){var e=0,t='<ul class="search-result-list">',a=this.value.trim().toLowerCase().split(/[\s\-]+/);n.innerHTML="",this.value.trim().length>1&&r.forEach(function(r){var c=!1,n=r.title.trim().toLowerCase(),s=r.content.trim().replace(/<[^>]+>/g,"").toLowerCase(),o=decodeURIComponent(r.url),i=-1,l=-1,p=-1;if(""!=n&&a.forEach(function(e,t){i=n.indexOf(e),l=s.indexOf(e),(i>=0||l>=0)&&(c=!0,0==t&&(p=l))}),c){e+=1,t+="<li><a href='"+o+"' class='search-result-title'>"+n+"</a>";var h=r.content.trim().replace(/<[^>]+>/g,"");if(p>=0){var u=p-20,d=p+80;u<0&&(u=0),0==u&&(d=50),d>h.length&&(d=h.length);var f=h.substring(u,d);a.forEach(function(e){var t=new RegExp(e,"gi");f=f.replace(t,'<b class="search-keyword">'+e+"</b>")}),t+='<p class="search-result">'+f+"...</p>"}t+="</li>"}}),t+="</ul>",0==e&&(t='<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'),""==a&&(t='<div id="no-result"><i class="fa fa-search fa-5x" /></div>'),n.innerHTML=t}),proceedsearch()}})};$(".popup-trigger").click(function(e){e.stopPropagation(),0==isfetched?searchFunc(path,"local-search-input","local-search-result"):proceedsearch()}),$(".popup-btn-close").click(function(e){$(".popup").hide(),$(".popoverlay").remove(),$("body").css("overflow","")}),$(".popup").click(function(e){e.stopPropagation()})</script><script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script><script>AV.initialize("DVv225OiXLJTYs0Imq4Kw1qL-gzGzoHsz","Kv6XNKTrebkacDbh2zRCsVYA")</script><script>function showTime(e){var t=new AV.Query(e),n=[],o=$(".leancloud_visitors");o.each(function(){n.push($(this).attr("id").trim())}),t.containedIn("url",n),t.find().done(function(e){var t=".leancloud-visitors-count";if(0===e.length)return void o.find(t).text(0);for(var i=0;i<e.length;i++){var r=e[i],s=r.get("url"),l=r.get("time"),c=document.getElementById(s);$(c).find(t).text(l)}for(var i=0;i<n.length;i++){var s=n[i],c=document.getElementById(s),u=$(c).find(t);""==u.text()&&u.text(0)}}).fail(function(e,t){console.log("Error: "+t.code+" "+t.message)})}function addCount(e){var t=$(".leancloud_visitors"),n=t.attr("id").trim(),o=t.attr("data-flag-title").trim(),i=new AV.Query(e);i.equalTo("url",n),i.find({success:function(t){if(t.length>0){var i=t[0];i.fetchWhenSave(!0),i.increment("time"),i.save(null,{success:function(e){var t=$(document.getElementById(n));t.find(".leancloud-visitors-count").text(e.get("time"))},error:function(e,t){console.log("Failed to save Visitor num, with error message: "+t.message)}})}else{var r=new e,s=new AV.ACL;s.setPublicReadAccess(!0),s.setPublicWriteAccess(!0),r.setACL(s),r.set("title",o),r.set("url",n),r.set("time",1),r.save(null,{success:function(e){var t=$(document.getElementById(n));t.find(".leancloud-visitors-count").text(e.get("time"))},error:function(e,t){console.log("Failed to create")}})}},error:function(e){console.log("Error:"+e.code+" "+e.message)}})}$(function(){var e=AV.Object.extend("Counter");1==$(".leancloud_visitors").length?addCount(e):$(".post-title-link").length>1&&showTime(e)})</script><script>!function(){var t=document.createElement("script"),s=window.location.protocol.split(":")[0];"https"===s?t.src="https://zz.bdstatic.com/linksubmit/push.js":t.src="http://push.zhanzhang.baidu.com/push.js";var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e)}()</script><script type="text/javascript">var OriginTitile=document.title,st;document.addEventListener("visibilitychange",function(){document.hidden?(document.title="╭(°A°`)╮好奇怪崩溃啦!",clearTimeout(st)):(document.title="(ฅ>ω<*ฅ) 噫又好了~ "+OriginTitile,st=setTimeout(function(){document.title=OriginTitile},4e3))})</script></body></html>
1
https://gitee.com/ehlxr/ehlxr.git
git@gitee.com:ehlxr/ehlxr.git
ehlxr
ehlxr
ehlxr
master

搜索帮助