kestrell: (Default)
[personal profile] kestrell
I'm trying to revive my knowledge of the command line interface, but can't remember how to change to the home directory. I'm actually trying to learn Git, so the help documentation assume I remember all the commands. I remember

Date: 2020-09-23 09:58 pm (UTC)
metahacker: Close-up of a computer screen showing a linux terminal. (drwxrwxrwx)
From: [personal profile] metahacker
The home directory is nicknamed ~, the tilde character, so cd ~ will get you there.

(In some shells, simply typing cd with no arguments will also get you there.)

Date: 2020-09-25 02:48 am (UTC)
metahacker: A picture of white-socked feet, as of a person with their legs crossed. (Default)
From: [personal profile] metahacker
Aha! The "The system cannot find the path specified." message means you're using Windows Command Prompt, which has its own syntax and whatnot. Command Prompt almost at the end of its life, so it may not worth investing in knowledge of it.

I don't know windows Command Prompt language much at all, but it shares some of the same commands as bash--just enough to be really confusing! And as yo say git does come with the git-bash program, which has a version of the bash shell, so that might be the one to use.

You can customize the bash prompt so it says whatever--including which git branch you are on (when you get to that step in your git learning). But getting it right is a little finicky, since it uses a lot of percent-string escape clauses (e.g. %~ for the current path including showing home as tilde).

I don't know which shells work well with screen readers, or if you can find a .bashrc file which will set you up with some sensible defaults, but there's got to be someone who has done some work in this area.

Date: 2020-09-25 02:55 am (UTC)
metahacker: Close-up of a computer screen showing a linux terminal. (drwxrwxrwx)
From: [personal profile] metahacker
Eeew. Well, that's annoying. I do hope you find a terminal program that reads as it prints.

As mentioned above you can customize the prompt; if you edit a file named ~/.bashrc (i.e. named .bashrc in your home directory) you can add a line like this:

PS1='\\w '

That'll change your prompt to just your current path, with a space after it. Replace the w with a capital W if you want it to only have the last element of the path (i.e. the folder you are in, rather than the whole path to that folder).

For more on bash prompt changing, page looked like it might be helpful and laid out well:

https://linuxconfig.org/bash-prompt-basics

February 2024

S M T W T F S
    123
456789 10
11121314151617
18192021222324
2526272829  

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 3rd, 2026 07:37 am
Powered by Dreamwidth Studios