Can not delete file due to “Invalid argument”












7














I got this weird error when I try to delete some file. And the filename doesn't contain any specific characters. Does anyone know why ? It is centos



[root@sandbox ~]# rm -rf /var/log/zookeeper
rm: cannot remove `/var/log/zookeeper': Invalid argument









share|improve this question
















bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Can you write to the file and try to delete it again? Like echo "foobar" > /var/log/zookeeper (brattex.blogspot.de/2012/07/…)
    – AndreiR
    Feb 16 '17 at 6:02










  • Actually this is a empty folder.
    – zjffdu
    Feb 16 '17 at 7:25










  • I see.. Maybe this one? unix.stackexchange.com/questions/317130/….
    – AndreiR
    Feb 16 '17 at 7:37










  • There may be something special about the directory. Post the output of ls -la zookeeper.
    – Murphy
    Feb 16 '17 at 9:10










  • Use rmdir to remove empty directories.
    – Mioriin
    Feb 16 '17 at 23:25
















7














I got this weird error when I try to delete some file. And the filename doesn't contain any specific characters. Does anyone know why ? It is centos



[root@sandbox ~]# rm -rf /var/log/zookeeper
rm: cannot remove `/var/log/zookeeper': Invalid argument









share|improve this question
















bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Can you write to the file and try to delete it again? Like echo "foobar" > /var/log/zookeeper (brattex.blogspot.de/2012/07/…)
    – AndreiR
    Feb 16 '17 at 6:02










  • Actually this is a empty folder.
    – zjffdu
    Feb 16 '17 at 7:25










  • I see.. Maybe this one? unix.stackexchange.com/questions/317130/….
    – AndreiR
    Feb 16 '17 at 7:37










  • There may be something special about the directory. Post the output of ls -la zookeeper.
    – Murphy
    Feb 16 '17 at 9:10










  • Use rmdir to remove empty directories.
    – Mioriin
    Feb 16 '17 at 23:25














7












7








7


1





I got this weird error when I try to delete some file. And the filename doesn't contain any specific characters. Does anyone know why ? It is centos



[root@sandbox ~]# rm -rf /var/log/zookeeper
rm: cannot remove `/var/log/zookeeper': Invalid argument









share|improve this question















I got this weird error when I try to delete some file. And the filename doesn't contain any specific characters. Does anyone know why ? It is centos



[root@sandbox ~]# rm -rf /var/log/zookeeper
rm: cannot remove `/var/log/zookeeper': Invalid argument






linux files directory rm






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 16 '17 at 23:19









Gilles

529k12810601586




529k12810601586










asked Feb 16 '17 at 5:51









zjffdu

14625




14625





bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • Can you write to the file and try to delete it again? Like echo "foobar" > /var/log/zookeeper (brattex.blogspot.de/2012/07/…)
    – AndreiR
    Feb 16 '17 at 6:02










  • Actually this is a empty folder.
    – zjffdu
    Feb 16 '17 at 7:25










  • I see.. Maybe this one? unix.stackexchange.com/questions/317130/….
    – AndreiR
    Feb 16 '17 at 7:37










  • There may be something special about the directory. Post the output of ls -la zookeeper.
    – Murphy
    Feb 16 '17 at 9:10










  • Use rmdir to remove empty directories.
    – Mioriin
    Feb 16 '17 at 23:25


















  • Can you write to the file and try to delete it again? Like echo "foobar" > /var/log/zookeeper (brattex.blogspot.de/2012/07/…)
    – AndreiR
    Feb 16 '17 at 6:02










  • Actually this is a empty folder.
    – zjffdu
    Feb 16 '17 at 7:25










  • I see.. Maybe this one? unix.stackexchange.com/questions/317130/….
    – AndreiR
    Feb 16 '17 at 7:37










  • There may be something special about the directory. Post the output of ls -la zookeeper.
    – Murphy
    Feb 16 '17 at 9:10










  • Use rmdir to remove empty directories.
    – Mioriin
    Feb 16 '17 at 23:25
















Can you write to the file and try to delete it again? Like echo "foobar" > /var/log/zookeeper (brattex.blogspot.de/2012/07/…)
– AndreiR
Feb 16 '17 at 6:02




Can you write to the file and try to delete it again? Like echo "foobar" > /var/log/zookeeper (brattex.blogspot.de/2012/07/…)
– AndreiR
Feb 16 '17 at 6:02












Actually this is a empty folder.
– zjffdu
Feb 16 '17 at 7:25




Actually this is a empty folder.
– zjffdu
Feb 16 '17 at 7:25












I see.. Maybe this one? unix.stackexchange.com/questions/317130/….
– AndreiR
Feb 16 '17 at 7:37




I see.. Maybe this one? unix.stackexchange.com/questions/317130/….
– AndreiR
Feb 16 '17 at 7:37












There may be something special about the directory. Post the output of ls -la zookeeper.
– Murphy
Feb 16 '17 at 9:10




There may be something special about the directory. Post the output of ls -la zookeeper.
– Murphy
Feb 16 '17 at 9:10












Use rmdir to remove empty directories.
– Mioriin
Feb 16 '17 at 23:25




Use rmdir to remove empty directories.
– Mioriin
Feb 16 '17 at 23:25










1 Answer
1






active

oldest

votes


















1














Something similar happened to me when I was trying to remove an empty folder from a remote server.
This is what ls -al was giving as output:



??????????   ? ?       ?       ? ? latest


This was a folder inside another folder and I wanted to delete this.
I tried rmdir and this is what I got:



rm: cannot remove: latest: Invalid argument


Nothing seemed to work directly on that folder(not rm -f, not touch, nothing). However, I tried renaming the parent folder and the latest folder was normal again, which I was then able to delete using rm.






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f345364%2fcan-not-delete-file-due-to-invalid-argument%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Something similar happened to me when I was trying to remove an empty folder from a remote server.
    This is what ls -al was giving as output:



    ??????????   ? ?       ?       ? ? latest


    This was a folder inside another folder and I wanted to delete this.
    I tried rmdir and this is what I got:



    rm: cannot remove: latest: Invalid argument


    Nothing seemed to work directly on that folder(not rm -f, not touch, nothing). However, I tried renaming the parent folder and the latest folder was normal again, which I was then able to delete using rm.






    share|improve this answer


























      1














      Something similar happened to me when I was trying to remove an empty folder from a remote server.
      This is what ls -al was giving as output:



      ??????????   ? ?       ?       ? ? latest


      This was a folder inside another folder and I wanted to delete this.
      I tried rmdir and this is what I got:



      rm: cannot remove: latest: Invalid argument


      Nothing seemed to work directly on that folder(not rm -f, not touch, nothing). However, I tried renaming the parent folder and the latest folder was normal again, which I was then able to delete using rm.






      share|improve this answer
























        1












        1








        1






        Something similar happened to me when I was trying to remove an empty folder from a remote server.
        This is what ls -al was giving as output:



        ??????????   ? ?       ?       ? ? latest


        This was a folder inside another folder and I wanted to delete this.
        I tried rmdir and this is what I got:



        rm: cannot remove: latest: Invalid argument


        Nothing seemed to work directly on that folder(not rm -f, not touch, nothing). However, I tried renaming the parent folder and the latest folder was normal again, which I was then able to delete using rm.






        share|improve this answer












        Something similar happened to me when I was trying to remove an empty folder from a remote server.
        This is what ls -al was giving as output:



        ??????????   ? ?       ?       ? ? latest


        This was a folder inside another folder and I wanted to delete this.
        I tried rmdir and this is what I got:



        rm: cannot remove: latest: Invalid argument


        Nothing seemed to work directly on that folder(not rm -f, not touch, nothing). However, I tried renaming the parent folder and the latest folder was normal again, which I was then able to delete using rm.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 21 '18 at 12:49









        cst1992

        1255




        1255






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f345364%2fcan-not-delete-file-due-to-invalid-argument%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

            is 'sed' thread safe

            How to make a Squid Proxy server?