LoginSignup
0
0

cp コマンド Linux

Last updated at Posted at 2024-01-26

ディレクトリの中身だけ全て、別のディレクトリ内にコピーする

例: target_dir/* を dist_dir/ にコピーする

カレントディレクトリ確認
tree

#├── goal_dir
#│   ├── cottino.gif
#│   ├── houni.png
#│   ├── ne.jpg
#│
#├── start_dir
#    ├── korewo.txt
#    ├── idou.txt
#    ├── sitainda.py 
コピー元ディレクトリ内でコピー実行
cd start_dir

cp -r `ls -A` ../goal_dir

参考

lsの「-A」オプションは
「.」と「..」以外の全てのファイルを表示するオプションです

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
0
0