Making a directory: mkdir

mkdir makes a new directory within the current directory. The access permissions for a directory that you create are set to a predetermined value which ensures that other users cannot get access to your directories and their contents.

Examples

  • mkdir specification
    creates a new directory called specification in your current working directory.

  • mkdir ../presentations
    Creates a directory called presentations in the parent directory of the current working directory. In effect, this creates a new directory at the same level of the file system as the current directory.

  • mkdir reports/january/amy
    Creates the directory amy in the subdirectory reports/january.

Problems?

  • :File exists
    There is already a directory with this name in the location in which you are trying to create the new directory

  • usage: mkdir [-p] directory ...
    You have entered the mkdir command without giving the name of a directory to be created.

  • : Read-only file system
    You do not have permission to make files in this directory. You can only list its contents.