Home TechnologySoftwareOperating SystemsLinux Subscribe to RSS

How Can I Create, Copy, Move And Remove A Directory In Linux?

Answer Question

1 Answer - Sort by: Date | Rating

    A directory in Linux can simply be created by using 'mkdir' command. So to create a new empty directory named shaam, we will simply write . And that's all. A new empty directory has been created by pressing enter after writing this command.

    Now if we want to copy directories to some other place, we will use 'cp' command. This 'cp' command is used to copy files actually so, in order to copy directories we must have to use a parameter '–r' with this command. This '–r' means to copy recursively. To move or rename the directories 'mv' command is used. If the destination directory does not exist, then by either 'cp' or 'mv' command a new directory will be created. Now to delete a directory we can use either of these commands. 'rmdir' or 'rm', but in case of rm we must have to use –r as a parameter while removing a directory. For example; if we want to remove a directory named shaam we can wither write or , after pressing enter this directory will be removed with all of its contents. And if we use –ir as a parameter with 'rm' command, then we will be prompted before the deletion of each file existing within the directory.
    0 0

    Srana 

    answered 3 years ago

      Answer Question - Answers are editable for 5 min.

      If you do not Sign-in or Register your answers will

      be anonymous, your answers may also be

      checked before going online.

      0

      More

      More

         
         

        Ask a Question via Twitter

        Send a question to @askblurtit and we will publish it online and send you a reply everytime you receive an answer.

        Blurtit Store

        Get T-shirts, hoodies, caps and more at the Blurtit store

        Blurtit International