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:

  1. The file called .bashrc
  2. Profile file for the bash shell.
  3. a very small amount or quantity
  4. vim is a text editor.
nano ~/.bashrc
  1. The location of the new directory
export DOWNLOAD_PATH="/path/to/new/directory"
export XDG_DOWNLOAD_DIR="$DOWNLOAD_PATH"
  1. Save and close the file, then execute the following command to apply the changes:
source ~/.bashrc
  1. 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.

bannerAds