このコマンドを使用してmv
一部のファイルが失われました。私は彼らがどこにいるのかわかりません。コピーしたいディレクトリにありません。
私が書いた記録は次のとおりです。
samuelcayo@CAYS07019906:~/Downloads/221-tp2-public-main$ cd
samuelcayo@CAYS07019906:~$ ls
Desktop Documents Downloads GameShell Music Pictures pratice Public Templates Videos
samuelcayo@CAYS07019906:~$ mkdir tp2
samuelcayo@CAYS07019906:~$ ls
Desktop Documents Downloads GameShell Music Pictures pratice Public Templates tp2 Videos
samuelcayo@CAYS07019906:~$ cd Downloads/221-tp2-public-main/
samuelcayo@CAYS07019906:~/Downloads/221-tp2-public-main$ ls
backup copybash Dockerfile ntfy-1.16.0 packets.txt README.md restore secret
cloud data Dockerfile_CAYS07019906 ntfy.zip rapport-tp2.md remplacer.sed sauvegarde.sh tail
samuelcayo@CAYS07019906:~/Downloads/221-tp2-public-main$ mv rapport-tp2.md tp2
samuelcayo@CAYS07019906:~/Downloads/221-tp2-public-main$ mv Dockerfile_CAYS07019906 tp2
samuelcayo@CAYS07019906:~/Downloads/221-tp2-public-main$ mv packets.txt tp2
samuelcayo@CAYS07019906:~/Downloads/221-tp2-public-main$ mv sauvegarde.sh tp2
samuelcayo@CAYS07019906:~/Downloads/221-tp2-public-main$ cd
samuelcayo@CAYS07019906:~$ cd tp2/
samuelcayo@CAYS07019906:~/tp2$ ls
samuelcayo@CAYS07019906:~/tp2$ ls -l
total 0
samuelcayo@CAYS07019906:~/tp2$ cd ..
ベストアンサー1
ホームディレクトリにというディレクトリを作成しますtp2
。つまり、ディレクトリを作成します~/tp2
。次に、に変更し~/Downloads/221-tp2-public-main
て使用を開始しますmv
。
mv
各ジョブの宛先をとして指定tp2
し、tp2
現在のディレクトリのディレクトリではないため、移動するすべてのファイルは名前変更 tp2
。後で実行するたびに、以前にtp2
呼び出されたファイルが上書きされますmv
。結局tp2
残っているのは以前に呼び出されたものですsauvegarde.sh
。
~/tp2/
これをすべてのタスクのターゲットとして使用すると、データの損失を防ぐことができますmv
。
ディレクトリ~
を作成したホームディレクトリを示します。tp2
ターゲットパスの終わりには必ずしも/
必要ではありませんが、mv
ディレクトリでない場合は正常に失敗します。~/tp2
失われたファイルを回復するために今できることについては、他の場所にコピーがない場合は、最近のバックアップから復元することを検討してください。