Change Linux Storage Path: Step-by-Step Guide
To change the default storage path in Linux, you can achieve this by modifying the environment variable. In Linux systems, the $HOME environment variable is typically used to represent the current user’s home directory, and the Downloads directory under $HOME is usually used to store downloaded files. If you want to change the default storage path to a different directory, you can follow the steps below:
- The file called .bashrc
- Profile file for the bash shell.
- a very small amount or quantity
- vim is a text editor.
nano ~/.bashrc
- The location of the new directory
export DOWNLOAD_PATH="/path/to/new/directory"
export XDG_DOWNLOAD_DIR="$DOWNLOAD_PATH"
- Save and close the file, then execute the following command to apply the changes:
source ~/.bashrc
- print the XDG_DOWNLOAD_DIR variable
Please note, the above steps are an example of modifying environment variables in the user’s home directory. If you want to change system-wide environment variables, you need to modify /etc/environment or other system configuration files. Modifying system-wide environment variables requires root permissions.