0

Ubuntu 20.04.1; Mate desktop

Is there an app I can install or already have that will 'wipe' just one directory on the drive? Or will a 'Cut' operation, then dropping the file(s) into removable media, completely erase those files?

Or is there a command that will do it in Term? As Root?

Thanks.

5
  • Define "wipe"? Is there anything wrong with rm?
    – Nmath
    Mar 12, 2021 at 0:42
  • I'm no security expert and like most people, I do my taxes online and download the forms to my HDD. By wipe, I mean over write the forms with 1's then 0's so they can't be recovered by any of those available recovery programs but since it's only 2 files in one folder, I'm looking for something that would only work on those two files. I don't want to wipe the entire disk. I don't know if rm will do it but I'll investigate that one. Thx.
    – Jim_HiTek
    Mar 13, 2021 at 1:33
  • I think that 'wipe' is the answer to just wiping a couple files. It's well documented with plenty of options and includes WARNINGS. I'll give it a try. manpages.ubuntu.com/manpages/hirsute/en/man1/wipe.1.html
    – Jim_HiTek
    Mar 13, 2021 at 1:47
  • Well if you are concerned about the recoverability of sensitive files, you should use whole disk encryption. Files can be duplicated in all sorts of places. For example, some software creates automatic backups of open files. If you overwrite one file several times, that would securely erase that particular file while leaving temporary files easily accessible in unencrypted plain text
    – Nmath
    Mar 13, 2021 at 4:16
  • No reason for the encryption of the whole disk, IMO, all I needed was a couple PDF tax forms that carried all my info wiped. Not tooooo worried about it in the first place what with the native anti hacking features as it is. But....better safe than sorry.
    – Jim_HiTek
    Mar 14, 2021 at 5:56

1 Answer 1

0

I think that the mv ( or move command ) would work.

  1. I'll create a test directory in my current directory.

    steve@AntHill2:~$ mkdir testdir
    
  2. Next I will throw a few random files into it.

    steve@AntHill2:~$ cp -p *.pdf  testdir
    
  3. Then verify that the files are present with the ls command

    steve@AntHill2:~$ ls testdir
    AWOJOBI-DISSERTATION-2020.pdf  
    R43215_2018Oct23.pdf  R45415_2018Nov28.pdf
    IF11029_2018Nov27.pdf          
    R45393_2018Nov02.pdf  RS20871_2018Nov28.pdf
    LSB10217_2018Nov15.pdf         
    R45394_2018Nov05.pdf
    
  4. Next I will move the directory including its files to the attached and mounted flash drive.

    steve@AntHill2:~$ mv testdir /media/steve/Backup
    
  5. To prove that the directory has been wiped off, I will try an ls command.

    steve@AntHill2:~$ ls -artl testdir
    ls: cannot access 'testdir': No such file or directory
    
  6. To show that the files are now on my removable drive.

    steve@AntHill2:~$ ls -artl /media/steve/Backup/testdir
    total 10504
    -rw-rw-r--  1 steve steve 2179135 Feb 22 23:13 AWOJOBI-DISSERTATION-2020.pdf
    -rw-rw-r--  1 steve steve  370498 Feb 22 23:20 IF11029_2018Nov27.pdf
    -rw-rw-r--  1 steve steve 1973673 Feb 22 23:22 RS20871_2018Nov28.pdf
    -rw-rw-r--  1 steve steve 1237639 Feb 22 23:23 R45394_2018Nov05.pdf
    -rw-rw-r--  1 steve steve 1805083 Feb 22 23:25 R45415_2018Nov28.pdf
    -rw-rw-r--  1 steve steve  570959 Feb 22 23:27 LSB10217_2018Nov15.pdf
    -rw-rw-r--  1 steve steve 1117265 Feb 22 23:29 R43215_2018Oct23.pdf
    -rw-rw-r--  1 steve steve 1416249 Feb 22 23:30 R45393_2018Nov02.pdf
    drwxrwxr-x  2 steve steve    4096 Mar 11 22:30 .
    drwxrwxrwt 22 root  root    61440 Mar 11 22:31 ..
    
  • I hope you can use this or something similar.

  • Though these are simple directory examples, the mv command can move complicated structures having subdirectories and files beneath them by moving the top directory name.

Not the answer you're looking for? Browse other questions tagged .