Skip to content

Instantly share code, notes, and snippets.

@simo54
Last active August 16, 2024 08:25
Show Gist options
  • Save simo54/c02e513ae13a6f8e23fa382bc4e28800 to your computer and use it in GitHub Desktop.
Save simo54/c02e513ae13a6f8e23fa382bc4e28800 to your computer and use it in GitHub Desktop.
Change default path on Ubuntu Terminal 20.04 LTS

Steps for changing the default path

  1. Open the terminal

  2. Digit the following line and press Enter once done

    echo "cd YOURPERSONALSTANDARDPATH" >> ~/.bashrc
    

    Restart the terminal and check the changes

Steps for updating / removing existing default path

  1. Digit the following line (link docs about Nano text editor)

    nano ~/.bashrc
    
  2. Scroll down with keyboards arrows, .bashrc is extremely sensible, do not touch the existing code

  3. Find at the end of the file the default path (the purpose is to have only one default path)

  4. Update the path and once done press CTRL+o (Write Out === Save changes)

  5. To exit from Nano, press CTRL+z and once back in the terminal digit exit to end the editor and then restart it to check the changes.

Credits

https://askubuntu.com/questions/332062/setting-default-path-when-opening-a-terminal-session

Images guide below ⬇

@AnastasiaOnyan
Copy link

thanks, it helps a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment