Forrest logo
back to the mkdir tool

nix:tldr:17330

nix: Enable the `nix` command.
$ mkdir -p ~/.config/nix; echo 'experimental-features = nix-command flakes' > ~/.config/nix/nix.conf
try on your machine

This command is performing two actions:

  1. mkdir -p ~/.config/nix:

    • mkdir is a command used to create directories in a file system.
    • -p is an option that allows the creation of parent directories if they don't exist.
    • ~/.config/nix specifies the path where the directory is created. ~ represents the user's home directory.

    The overall effect of this part of the command is to ensure that the ~/.config/nix directory exists. If it already exists, the command will have no effect.

  2. echo 'experimental-features = nix-command flakes' > ~/.config/nix/nix.conf:

    • echo is a command used to print text or variables to the terminal.
    • 'experimental-features = nix-command flakes' is the text being printed by the echo command.
    • > redirects the output of the echo command and writes it to the specified file instead of printing it to the terminal.
    • ~/.config/nix/nix.conf specifies the path and filename where the text is being written.

    The overall effect of this part of the command is to create a file named nix.conf in the ~/.config/nix directory (created in the previous step), containing the line experimental-features = nix-command flakes.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the mkdir tool