Skip to content
This repository was archived by the owner on Mar 19, 2022. It is now read-only.

Latest commit

 

History

History
25 lines (19 loc) · 2.55 KB

File metadata and controls

25 lines (19 loc) · 2.55 KB

Day 2

Notes

  • Configured PS1 which had been pending for several days. I wanted a simple way to know if I am inside a git directory or not and nothing else (not using zsh, not powerlevel10k, just bash). So I did this and here is the output. I followed arch wiki which says to avoid using PROMPT_COMMAND for printing characters to terminal because bash doesn't count those characters and so, it may end up placing the cursor at a position which doesn't include the calculation of characters from PROMPT_COMMAND. However, it could have been used to reassign PS1 but my PS1 was already long. PS1 is set once when it used for the first time, so the trick to embed commands is to avoid expansion the first time either by single quotes or backslashing the dollar of command subsititution. It will be expanded, when the prompt is actually display. ps1 look

  • read a bit of man pages for several commands.

  • help <shellbuitin> instead of <shellbuitin> --help (example, echo --help will print --help).

  • man builtins will show all builtins.

  • Anyways, I usually try all these things, man program, program --help, info program, help program, and either one or more will give me what I want.

  • ls -t to sort files in descending order last-modified.

  • ls -Falhit is a good use along with already aliased ls='ls --color=auto'.

Readings