Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cdi - Change Directory Interactively

A Bash script with interactive TUI - by DavidBevi (not Antônio Oliveira's cdi)

GIF

How to use

Install

❶ download cdi.sh, ❷ put in /usr/local/bin/, ❸ make the cdi alias. Here's a command that does all 3 steps:

sudo curl "https://raw.githubusercontent.com/DavidBevi/cdi/refs/heads/main/cdi.sh" -o "/usr/local/bin/cdi.sh" && echo -e '\nalias cdi=". /usr/local/bin/cdi.sh"' >> ~/.bashrc && . ~/.bashrc

Use

Run cdi with command cdi.

Details: cdi must be sourced, that is source cdi.sh or . cdi.sh.
With ./cdi.sh or bash cdi.sh a sub-shell is created, and cdi will cd the sub-shell and exit.
To save you an headache cdi only works when sourced, and prints an helpful text otherwise.


Help

What's a shell?

Shells are programs that accepts textual commands, Bash is the most famous and popular Linux shell. Usually you might also call it "terminal", but the "terminal emulator" is the program that displays the input and output of the shell. You can change shell without changing terminal (or the opposite).

Check your shell

Run ps -p $$ -o comm=, if it doesn't print back bash you're not on Bash. But usually you can still enter Bash by running bash.

Temporarily change shell

Run bash and work there: this command calls a sub-shell, from which you can do your normal stuff. You can return to the caller-shell with exit and usually with ctrl+d.

Permanently change shell

Run chsh -s /usr/bin/bash and type the superuser password (the one you type for sudo).


Acknowledgement

Antônio Oliveira in 2020 made cdi, which is inactive since then. My cdi is a complete rewrite, done because I wanted learn Bash scripting by building a script myself.

After doing so I was hoping to merge the 2 projects somehow, but Antônio kindly declined, so I'll do my best to maintain this cdi.


About

Change Directory Interactively - bash script with interactive TUI

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages