Ubuntu – Is there any shortcut for parent folder in console

command lineshortcut-keys

I would like to know if there is any plugins and/or utilities that could make my life MUCH MORE easier.

When moving from folder to folder through console, I can use the Tab key on my keyboard to autocomplete a folder, look for a folder (double tap) or simply to express that I want to go "forward" with my searches.

When coding, the Tab key is used to "push" the code "forward" or to the right. To "pull" the code "backward", you can use the combination of Shift+Tab keys.

Is there an equivalent for, as an example, pressing the Shift+Tab keys to write ../ in the console for me? Or to let me know I'm at the root level and that I can't go "backward" anymore?

Examples of usage:

Case 1:

user@server:/$ cd ~/Desktop/folder1/

after Shift+Tab

user@server:/$ cd ~/Desktop/(Remove the last written folder. No more backspace spam!! 😀 )

Case 2:

user@server:/$ cd

after Shift+Tab

user@server:/$ cd (Because I'm at root and can't go back)

Case 3:

user@server:/home/Desktop/folder1$ cd

after Shift+Tab

user@server:/home/Desktop/folder1$ cd ../ (Because I can go back to Desktop)

I know that sounds lazy. I know I'm lazy.

Anyways, thanks for the suggestions! (:

Edit:
Just to be clear. I gave as an example the cd command, but what I want could be applied to any command/executable. It would be considered a basic use just like Tab is used to autocomplete.

Best Answer

Create this file /home/$USER/.inputrc with the following:

# ~/.inputrc - complements /etc/inputrc - global inputrc for libreadline
# April 15, 2019
# See readline(3readline) and `info rluserman' for more information.

$include /etc/inputrc

# Insert key to togged overwrite-mode
"\e[2~": overwrite-mode

# April 22, 2019 AU Q&A: https://askubuntu.com/q/1135306/307523
# Make Shift-tab act like "cd ../" (move to parent directory)
"\e[Z": "cd ../"

Save the file and open a new terminal.

Now you can use Shift+Tab to send cd ../ to the terminal.

Also included in the settings you can press Insert key to toggle between character overwrite (replace) mode and insert mode.