トップ/web/linux_command

web/linux_command の変更点


#author("2023-12-24T21:15:16+09:00","default:nemusg.pad","nemusg.pad")
#author("2025-01-01T21:08:28+09:00","default:nemusg.pad","nemusg.pad")
* Linuxのコマンド(?) [#k416da98]

SSH接続とかで使えるはず

** ファイルのコピー [#i46fc868]

*** cp [#u9496967]

nemusg.comをコピーしてnemusg.com.140803を作成したい場合
nemusg.comをコピーして `note.nemusg.com.240101` を作成したい場合

#code_x{{
cp -Rp nemusg.com nemusg.com.140803
cp -Rp note.nemusg.com note.nemusg.com.240101
}}

*** rsync [#d6bb1bd1]

特定のフォルダなどを除外したcpをしたい場合rsyncのが楽らしい

#code_x{{
$ rsync [[オプション] コピー元 コピー先
}}

(例)nemusg.comをコピーしたいが、nemusg.com/cache/ だけ除外したい場合

#code_x{{
rsync -a nemusg.com/ nemusg.com.140803/ --exclude "/cache/"
}}

- [[rsync でよく使うオプション:http://takuya-1st.hatenablog.jp/entry/20110217/1297941165]]
- [[はじめてrsyncを使う方が知っておきたい6つのルール:http://www.itmedia.co.jp/enterprise/articles/0804/21/news013.html]]