0

Here is the folder and its content.I don't understand why I cannot remove these files and this folder. ls -ltr results in:

total 16672704
-rwxrwxrwx 0 17064381527 Eyl  2 18:10 101737-31-HO-EO_L03_99_merged.bam
-rwxrwxrwx 0 8395632 Eyl  2 18:10 101737-31-HO-EO_L03_99_merged.bam.bai
-rwxrwxrwx 0 4503304 Eyl  2 19:52 101737-31-HO-EO_L03_99.g.vcf.gz
-rwxrwxrwx 0 49778 Eyl  2 19:54 output.txt

sudo rm -rf * results in:

rm: cannot remove '101737-31-HO-EO_L03_99.g.vcf.gz': No such file or directory
rm: cannot remove '101737-31-HO-EO_L03_99_merged.bam': No such file or directory
rm: cannot remove '101737-31-HO-EO_L03_99_merged.bam.bai': No such file or directory
rm: cannot remove 'output.txt': No such file or directory

Using sudo rm -rf merged_bam_bai to delete the whole folder doesn't help either.

My Ubuntu version is 18.04.5 LTS

  • Have you tried when merged_bam_bai isn't your working directory? – Zeiss Ikon Sep 02 '21 at 17:35
  • @Zeiss Ikon Yes I did. It says rm: cannot remove 'merged_bam_bai/': Directory not empty – Baran Aldemir Sep 02 '21 at 17:38
  • Nope using sudo doesn't help. @TBr – Baran Aldemir Sep 02 '21 at 17:45
  • Try deleting each file independently first and empty the directory. –  Sep 02 '21 at 17:51
  • @TBr These files are created by using GATK bioinformatics tools. And this is the first time this has happened. And yeah I used these tools with nohup as gnks user. – Baran Aldemir Sep 02 '21 at 17:55
  • 1
    Please do not post pictures of your terminal. Copy-paste and use code fences for formatting. Put three back ticks on the line before and three back ticks on the line after code blocks. Thanks – Nmath Sep 02 '21 at 17:57
  • @TBr Trying to delete each file independently doesn't work either. – Baran Aldemir Sep 02 '21 at 17:57
  • Have you used this tool with this VM before? And yes definitely remove those pics per Nmath –  Sep 02 '21 at 17:59
  • @TBr Yes this is not the first time. I run this process to get such files many many times. – Baran Aldemir Sep 02 '21 at 18:10
  • I wonder if this might be related to one file being about a hundred times the total size of all the files? – Zeiss Ikon Sep 02 '21 at 18:10
  • 1
    What is the filesystem that this is on? – v010dya Sep 02 '21 at 18:11
  • That ls -l output is strange. After the permissions field (-rwxrwxrwx), there is a number of 0 links to the file (there should be at least 1), and there are no owner/group fields. Is this directory maybe some network share? If yes, it may be mounted read-only, that's why you can't delete. – raj Sep 02 '21 at 18:16
  • Somehow problem has been solved. I am not sure but maybe some process was still running in the background and when it stopped files got removed. I don't know about the filesystem. – Baran Aldemir Sep 02 '21 at 18:18

1 Answers1

0

you may need to use sudo rm to remove them, but read this first: Is the command `sudo rm /Desktop/filename` safe? To be safe run an ls command first to be sure you capture ONLY the files you intend to delete, then replace the ls with sudo rm