To change directories in Git Bash, you use the cd command, which stands for "change directory." Here's how you can do it:
Basic Syntax
cd [directory_path]
Examples
Change to a Specific Directory:
cd /c/Users/YourUsername/DocumentsThis command navigates to the
Documentsfolder in your user directory.Move Up One Directory:
cd ..This command takes you up one level in the directory hierarchy.
Change to Home Directory:
cd ~This command brings you back to your home directory.
Change to Previous Directory:
cd -This command switches back to the last directory you were in.
Using Relative Paths: If you're in
/c/Users/YourUsername/and want to go toDocuments, you can simply do:cd Documents
Tips
- Use Tab for autocompletion. Start typing a directory name and press Tab to autocomplete.
- To see the current directory, use:
pwd
Remove the Existing Directory
If you don’t need the existing odm-ops directory, you can remove it. Be careful with this command, as it will delete all contents within that directory:
rm -rf test
No comments:
Post a Comment