how to re-create the .Trash file in ubuntu server

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
-3
down vote

favorite












I recently deleted the .Trash file in Ubuntu server using the command



alias rm="mv -t ~/.Trash"


and now I am unable to delete any file using rm command, and when I use it I get:



mv: accessing `/home/user1/.Trash': No such file or directory.


How can I re-create the .Trash file to be able to delete files?







share|improve this question


















  • 1




    try mkdir ~/.Trash
    – Eskander Bejaoui
    May 19 at 23:11










  • it works ! thank you so much
    – Maen Salman
    May 19 at 23:12






  • 1




    no problem. I want to note that you're not deleting files with that alias, you're just moving them to another directory. is that the intended behaviour? Ubuntu server doesn't use a "trash" by default
    – Eskander Bejaoui
    May 19 at 23:26














up vote
-3
down vote

favorite












I recently deleted the .Trash file in Ubuntu server using the command



alias rm="mv -t ~/.Trash"


and now I am unable to delete any file using rm command, and when I use it I get:



mv: accessing `/home/user1/.Trash': No such file or directory.


How can I re-create the .Trash file to be able to delete files?







share|improve this question


















  • 1




    try mkdir ~/.Trash
    – Eskander Bejaoui
    May 19 at 23:11










  • it works ! thank you so much
    – Maen Salman
    May 19 at 23:12






  • 1




    no problem. I want to note that you're not deleting files with that alias, you're just moving them to another directory. is that the intended behaviour? Ubuntu server doesn't use a "trash" by default
    – Eskander Bejaoui
    May 19 at 23:26












up vote
-3
down vote

favorite









up vote
-3
down vote

favorite











I recently deleted the .Trash file in Ubuntu server using the command



alias rm="mv -t ~/.Trash"


and now I am unable to delete any file using rm command, and when I use it I get:



mv: accessing `/home/user1/.Trash': No such file or directory.


How can I re-create the .Trash file to be able to delete files?







share|improve this question














I recently deleted the .Trash file in Ubuntu server using the command



alias rm="mv -t ~/.Trash"


and now I am unable to delete any file using rm command, and when I use it I get:



mv: accessing `/home/user1/.Trash': No such file or directory.


How can I re-create the .Trash file to be able to delete files?









share|improve this question













share|improve this question




share|improve this question








edited May 20 at 9:35









David Foerster

25.9k1361106




25.9k1361106










asked May 19 at 23:05









Maen Salman

32




32







  • 1




    try mkdir ~/.Trash
    – Eskander Bejaoui
    May 19 at 23:11










  • it works ! thank you so much
    – Maen Salman
    May 19 at 23:12






  • 1




    no problem. I want to note that you're not deleting files with that alias, you're just moving them to another directory. is that the intended behaviour? Ubuntu server doesn't use a "trash" by default
    – Eskander Bejaoui
    May 19 at 23:26












  • 1




    try mkdir ~/.Trash
    – Eskander Bejaoui
    May 19 at 23:11










  • it works ! thank you so much
    – Maen Salman
    May 19 at 23:12






  • 1




    no problem. I want to note that you're not deleting files with that alias, you're just moving them to another directory. is that the intended behaviour? Ubuntu server doesn't use a "trash" by default
    – Eskander Bejaoui
    May 19 at 23:26







1




1




try mkdir ~/.Trash
– Eskander Bejaoui
May 19 at 23:11




try mkdir ~/.Trash
– Eskander Bejaoui
May 19 at 23:11












it works ! thank you so much
– Maen Salman
May 19 at 23:12




it works ! thank you so much
– Maen Salman
May 19 at 23:12




1




1




no problem. I want to note that you're not deleting files with that alias, you're just moving them to another directory. is that the intended behaviour? Ubuntu server doesn't use a "trash" by default
– Eskander Bejaoui
May 19 at 23:26




no problem. I want to note that you're not deleting files with that alias, you're just moving them to another directory. is that the intended behaviour? Ubuntu server doesn't use a "trash" by default
– Eskander Bejaoui
May 19 at 23:26










1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










You can (re-)create directories with the mkdir command. In this case:





mkdir -m 700 ~/.Trash


-m 700 sets the directory access mode to prohibit access to other users since they shouldn't normally snoop in your trash even if they otherwise share read access to your home directory.




Additionally you should probably remove the misleading rm alias:



unalias rm


If you want a command to move files to trash like many (graphical) file managers do you can use the gvfs-trash application from the gvfs-bin package (not installed by default in Ubuntu Server). If that's too long to type for you you can set up an alias similar to this:



alias trash='gvfs-trash'





share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    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',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1038224%2fhow-to-re-create-the-trash-file-in-ubuntu-server%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    You can (re-)create directories with the mkdir command. In this case:





    mkdir -m 700 ~/.Trash


    -m 700 sets the directory access mode to prohibit access to other users since they shouldn't normally snoop in your trash even if they otherwise share read access to your home directory.




    Additionally you should probably remove the misleading rm alias:



    unalias rm


    If you want a command to move files to trash like many (graphical) file managers do you can use the gvfs-trash application from the gvfs-bin package (not installed by default in Ubuntu Server). If that's too long to type for you you can set up an alias similar to this:



    alias trash='gvfs-trash'





    share|improve this answer


























      up vote
      0
      down vote



      accepted










      You can (re-)create directories with the mkdir command. In this case:





      mkdir -m 700 ~/.Trash


      -m 700 sets the directory access mode to prohibit access to other users since they shouldn't normally snoop in your trash even if they otherwise share read access to your home directory.




      Additionally you should probably remove the misleading rm alias:



      unalias rm


      If you want a command to move files to trash like many (graphical) file managers do you can use the gvfs-trash application from the gvfs-bin package (not installed by default in Ubuntu Server). If that's too long to type for you you can set up an alias similar to this:



      alias trash='gvfs-trash'





      share|improve this answer
























        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        You can (re-)create directories with the mkdir command. In this case:





        mkdir -m 700 ~/.Trash


        -m 700 sets the directory access mode to prohibit access to other users since they shouldn't normally snoop in your trash even if they otherwise share read access to your home directory.




        Additionally you should probably remove the misleading rm alias:



        unalias rm


        If you want a command to move files to trash like many (graphical) file managers do you can use the gvfs-trash application from the gvfs-bin package (not installed by default in Ubuntu Server). If that's too long to type for you you can set up an alias similar to this:



        alias trash='gvfs-trash'





        share|improve this answer














        You can (re-)create directories with the mkdir command. In this case:





        mkdir -m 700 ~/.Trash


        -m 700 sets the directory access mode to prohibit access to other users since they shouldn't normally snoop in your trash even if they otherwise share read access to your home directory.




        Additionally you should probably remove the misleading rm alias:



        unalias rm


        If you want a command to move files to trash like many (graphical) file managers do you can use the gvfs-trash application from the gvfs-bin package (not installed by default in Ubuntu Server). If that's too long to type for you you can set up an alias similar to this:



        alias trash='gvfs-trash'






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited May 21 at 23:06

























        answered May 20 at 9:42









        David Foerster

        25.9k1361106




        25.9k1361106






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1038224%2fhow-to-re-create-the-trash-file-in-ubuntu-server%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            pylint3 and pip3 broken

            Missing snmpget and snmpwalk

            How to enroll fingerprints to Ubuntu 17.10 with VFS491