0

I have files like:

ls CONFIG2
DOS      DOSCAR    KPOINTS  PCDAT   WAVECAR        submit_vasp_beskow.sh
CHG      EIGENVAL  OSZICAR  POSCAR  XDATCAR        vasprun.xml
CHGCAR   IBZKPT    OUT      POTCAR  error_file.e
CONTCAR  INCAR     OUTCAR   PROCAR  output_file.o
ls CONFIG2/DOS/
CHG      EIGENVAL  OSZICAR  POSCAR   error_file.e
CHGCAR   IBZKPT    OUT      POTCAR   output_file.o
CONTCAR  INCAR     OUTCAR   PROCAR   submit_vasp_beskow.sh
DOSCAR   KPOINTS   PCDAT    XDATCAR

I am trying to delete selected files from both the folders and I tried:

 rm -rvf CONFIG2[/DOS[/PROCAR, /CHG*, /vasprun.xml]]

ending up with error:

rm: cannot remove 'CONFIG2[/DOS[/PROCAR,': No such file or directory
rm: cannot remove '/CHG*,': No such file or directory
rm: cannot remove '/vasprun.xml]]': No such file or directory

Where I am going wrong here?

  • Which shell are you using bash, or other (zsh, ksh or other). Don't think the bash glob supports the format you are trying to do – Inian Mar 26 at 6:31
1

You need {}, not []:

echo CONFIG2{,/DOS}/{PROCAR,CHG*,vasprun.xml}

You also mustn’t use spaces after the commas.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.