Cara Hapus File di VPS Linux
1️⃣ Hapus file biasa
rm namafile
Contoh: rm file.txt → Menghapus file file.txt di folder saat ini.
2️⃣ Hapus file di folder tertentu
rm /path/to/namafile
Contoh: rm /etc/nginx/sites-available/default
3️⃣ Hapus banyak file sekaligus
rm file1.txt file2.txt file3.txt
4️⃣ Hapus semua file dalam folder
rm -f /path/folder/*
⚠️ Hati-hati! Ini akan menghapus semua file dalam folder tersebut.
5️⃣ Hapus folder beserta isinya
rm -rf /path/folder
Contoh: rm -rf /usr/local/src/neofetch
6️⃣ Cek file sebelum dihapus
ls -l /path/folder
find / -type f -name "namafile*"
Gunakan untuk memastikan file yang mau dihapus benar.