Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

コンテンツデータのコピペ方

Posted at

cpコマンド

shopt -s dotglob #隠しファイルもコピーできるようになる
cp -p /old/document/root/* /new/document/root/ #旧から新へコピペ
shopt -u dotglob #設定解除

rsyncコマンド

rsync -av --progress /old/document/root/ /new/document/root/

各オプションの意味

  • a :アーカイブモード(ディレクトリ構造・シンボリックリンク・パーミッション・所有者などを保持しつつコピー)

  • v :冗長モード(コピーされるファイル名などを表示)

  • --progress :進行状況(コピーの進み具合)を表示

パスの最後の / の意味

  • 中身だけをコピー(/old/document/root/ の中のファイルを対象)

/ がない場合

  • ディレクトリごとコピーされる(/old/document/root/ フォルダごと複製)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up

Comments

No comments

Let's comment your feelings that are more than good

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Login to continue?

Login or Sign up with social account

Login or Sign up with your email address