2018年2月7日水曜日

CentOS7にPython3をインストール(再)

CentOS7に元々含まれている Python2.x はそのままにして、
Python3.x をインストールします。
※Python2をPython3に置き換えてしまうとyumが動かないので。

リポジトリを追加。
$ sudo yum install -y https://centos7.iuscommunity.org/ius-release.rpm

現状、最新は3.6なので3.6をインストール。
$ yum search python36
$ sudo yum install python36u python36u-libs python36u-devel python36u-pip

確認。
$ python --version
Python 2.7.5

$ python3.6 --version
Python 3.6.2

シンボリックリンクを確認してみました。
$ ls -l /usr/bin/python*

以下のようになっていました。
/usr/bin/python -> python2
/usr/bin/python2 -> python2.7
/usr/bin/python2.7
/usr/bin/python2.7-futurize
/usr/bin/python2.7-pasteurize
/usr/bin/python3.6
/usr/bin/python3.6-config -> /usr/bin/python3.6m-config
/usr/bin/python3.6m
/usr/bin/python3.6m-config
/usr/bin/python3.6m-x86_64-config


参考
CentOS7にPython3をインストール - Qiita
https://qiita.com/estaro/items/5a9e4eb8f0902b9977e3

コーディング初心者こそ知っておきたい便利な「CSS関数」5選|ferret [フェレット]

https://ferret-plus.com/8336?utm_source=ferret&utm_medium=email&utm_campaign=20180207-1



◉ Sent from my iPhone

2018年2月1日木曜日

Linux xargs コマンド

xargs コマンド | コマンドの使い方(Linux) | hydroculのメモ
http://hydrocul.github.io/wiki/commands/xargs.html


findで見つけたファイルを一括削除する

$ find . -name "*.txt" | xargs rm

以下も同様だが、findの結果が多すぎるとエラーになる
$ rm `find . -name "*.txt"`

Mac OSXでssh-copy-idを使う

OSXでssh-copy-id
https://qiita.com/sl2/items/90c0b022190425c27d06


Macでssh-copy-idが使えなかったので以下のようにインストールしました。

1.GitHubよりダウンロード
# curl https://raw.githubusercontent.com/beautifulcode/ssh-copy-id-for-OSX/master/ssh-copy-id.sh
-o
/usr/local/bin/ssh-copy-id

2.実行権限の付与
# chmod +x /usr/local/bin/ssh-copy-id