NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

RaedyNas's avatar
RaedyNas
Aspirant
Jun 28, 2023
Solved

Delete folder starting with double backslash

Usuing ssh, how to remove a folder that has 2 backslashes? I can't cd or rm on the folder. From pic I would like to remove \\2020servertower and \\NAS-EA-70-E5

 

ReadyNas OS6 Pro


  • RaedyNas wrote:

    Usuing ssh, how to remove a folder that has 2 backslashes? I can't cd or rm on the folder. From pic I would like to remove \\2020servertower and \\NAS-EA-70-E5

     


    How did you manage to create them?

     

    Note the file names aren't \\2020servertower and \\NAS-EA-70-E5.  The single backslash isn't part of the path, so the full names include everything after the single backslash.  That includes the spaces.

     

    First do an ls -als to let you know if you are dealing with files or folders.  It wouldn't surprise me if these are actually soft links.  They could also somehow be mount points, so maybe run this also, and see if it returns any results:

    mount | grep '\\'

     

    You could try using wildcards - ??2020servertower* and ??NAS-EA-70-E5*

     

    Or you could try putting a single quote around the full file name.

     

    Either way, be very careful.  You are working in the system root, and if you use the wrong commands you could easily end up with an unbootable NAS.  I suggest using the -i option in rm (requiring confirmation before every deletion)

3 Replies

Replies have been turned off for this discussion

  • RaedyNas wrote:

    Usuing ssh, how to remove a folder that has 2 backslashes? I can't cd or rm on the folder. From pic I would like to remove \\2020servertower and \\NAS-EA-70-E5

     


    How did you manage to create them?

     

    Note the file names aren't \\2020servertower and \\NAS-EA-70-E5.  The single backslash isn't part of the path, so the full names include everything after the single backslash.  That includes the spaces.

     

    First do an ls -als to let you know if you are dealing with files or folders.  It wouldn't surprise me if these are actually soft links.  They could also somehow be mount points, so maybe run this also, and see if it returns any results:

    mount | grep '\\'

     

    You could try using wildcards - ??2020servertower* and ??NAS-EA-70-E5*

     

    Or you could try putting a single quote around the full file name.

     

    Either way, be very careful.  You are working in the system root, and if you use the wrong commands you could easily end up with an unbootable NAS.  I suggest using the -i option in rm (requiring confirmation before every deletion)

    • RaedyNas's avatar
      RaedyNas
      Aspirant

      Thanks!

      How did you manage to create them? A program called syncthing default save location was the root.  I let a user create a folder and they didn't change the folder location. It started filling up the file space, luckily it stopped before full. I'm trying to clean it all up now.

       

      I think I understood that the whole file/folder name is the full line, my lack of knowledge on the back slashes messing it up somehow.  I had tried to go into the folder with many combinations: encased in (double) quotes, adding slashes, removing slashes, no slashes, etc… Guess I missed the single quote

       

      Mount | grep ‘\\’ didn’t return anything.

       

      I was able to navigate to the folder with the wildcards. Checked the size of it with ls -als -h and then removed it.

       

      Would this look like a normal root now?

       

      • StephenB's avatar
        StephenB
        Guru

        My RN526 root looks like this:

         

        16 drwxr-xr-x   1 root  root   260 Jun 30 00:05 .
        16 drwxr-xr-x   1 root  root   260 Jun 30 00:05 ..
         0 drwxrwxr-x   1 admin admin  212 May 22 11:07 apps
         0 drwxr-xr-x   1 root  root  1338 May 22 11:05 bin
         0 drwxr-xr-x   1 root  root     0 May 21  2012 boot
        32 drwxr-xr-x   1 root  root   510 Feb 22 20:40 data
         0 drwxr-xr-x  16 root  root  3440 May 22 11:07 dev
         0 drwxr-xr-x   1 root  root  2800 Jun 16 09:38 etc
         0 drwxr-xr-x   1 root  root    54 May 22 11:05 frontview
         0 -rw-r--r--   1 root  root     0 Nov  9  2016 ftp_ban.tbl
         0 drwxr-xr-x   1 admin admin   10 Mar 12 09:34 home
         4 lrwxrwxrwx   1 root  root     5 Nov 22  2016 homes -> /home
         0 drwxr-xr-x   1 root  root   462 May 22 11:05 lib
         0 drwxr-xr-x   1 root  root    40 May 22 11:05 lib64
         0 drwxr-xr-x   1 root  root    32 Jun  4  2012 media
         0 drwxr-xr-x   1 root  root     0 Jan 25  2016 mnt
         0 drwxr-xr-x   1 root  root    98 Oct 11  2022 opt
         0 dr-xr-xr-x 243 root  root     0 May 22 11:05 proc
         4 -rw-------   1 root  root  1024 Nov 23  2016 .rnd
         0 drwx------   1 root  root    92 Jun 20 13:20 root
         0 drwxrwxr-x  24 root  admin  860 Jun 30 05:00 run
         0 drwxr-xr-x   1 root  root  2590 May 22 11:05 sbin
         0 drwxr-xr-x   1 root  root     0 Jun  4  2012 srv
         0 dr-xr-xr-x  12 root  root     0 May 22 11:06 sys
         0 drwxrwxrwt   1 root  root   210 Jun 30 06:25 tmp
         0 -rw-r--r--   1 root  root     0 May 22 11:04 .update_success
         0 drwxr-xr-x   1 root  root    70 Oct 11  2022 usr
         0 drwxr-xr-x   1 root  root   146 May 22 11:05 var

        Mine has

        1. No selinux folder
        2. a softlink from homes-> /home that yours is missing.
        3. an empty ftp_ban.tbl

        FTP is enabled on my NAS, perhaps not on yours.

         

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More