Reputation: 139
It's bit annoying to type cd
every time that I wish to Change Directory and then folder path/name.
So, any ways to avoid it? Without installing any extra stuff..
In case if things are blur: I wanted a replacement for this prompt> cd folder
with this prompt> folder
Upvotes: 1
Views: 349
Reputation: 1406
Open your terminal (ctrl + alt + t), type sudo su
then enter your password
(I am using leafpad
text editor to edit the .bashrc
file. If you also want to use leafpad
, install it using sudo apt-get install leafpad
command, Otherwise, you can use any other text editor as you wish)
Type the following command leafpad ~/.bashrc
to edit the .bashrc
file.
Add the following command at the end of the file and save the file
shopt -s autocd
Update the changes made in the .bashrc
file with the following command:
source ~/.bashrc
All Done :)
OR
echo 'shopt -s autocd' >> ~/.bashrc ; . ~/.bashrc
will suffice
Upvotes: 3