I’ve been trying to customize my Ubuntu terminal.
My next self made task is for the Ubuntu terminal to load a specific path rather than the default on on opening.
To be more specific, I have Nginx installed and want to open that folder on start up.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
In such cases, you can use the .bashrc file in your user’s root folder. In the .bashrc file you can add any command you want, you can create aliases and so on.
Basically, what you need to do is go to your user’s root folder:
On the top of the file add
where /path/to/nginx/installation is your actual path.
Additionally, you do not have to limit yourself to only this command. Let’s say you want to list the directory as well, just for the kicks of it. You can add
ls -lahin the same file underneath the cd command as well.
Usually, once you’ve created aliases or added such commands to your .bashrc file, you need to either reload it or open a new terminal(it reloads/loads by default on new terminal.). You can do it with:
Just to give you more information on what else you can achieve with changing/customizing your .bashrc file, you can also add colors to your terminal from there.
To add colors to the shell prompt use the following export command syntax: ‘\e[x;ym $PS1 \e[m’ Where,
You can change the color of the shell prompt by setting the PS1
To set a red color prompt, type the following export command:
Here is a list of colors:
Want to learn more? Join the DigitalOcean Community!
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Sign up now
This comment has been deleted