Timeline for Paths as bash aliases only work in parent directories?
Current License: CC BY-SA 4.0
14 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 13, 2022 at 16:52 | comment | added | weygoldt | @terdon there was no .bash_aliases file but there already was a snippet in the .bashrc that looked for one, so I created it since it seemed to be convenient to offload it to another file. | |
| Mar 13, 2022 at 14:48 | answer | added | frabjous | timeline score: 0 | |
| Mar 13, 2022 at 13:21 | answer | added | Gilles 'SO- stop being evil' | timeline score: 3 | |
| Mar 13, 2022 at 13:14 | comment | added | terdon♦ | @animbehav oh, Debian also has ~/.bash_aliases? Huh.it didn't last time I was using it so I had thought it was an Ubuntu thing. | |
| Mar 13, 2022 at 12:47 | comment | added | weygoldt | @terdon yes, exaclty. I'm on debian but I am currently working on a portable dotfiles setup, so making it live in the ~/.bash_aliases makes a git pull of my dotfiles easier to handle since don't have to delete the native .bashrc. | |
| Mar 13, 2022 at 12:42 | vote | accept | weygoldt | ||
| Mar 13, 2022 at 11:47 | comment | added | terdon♦ | @animbehav I suspect you mean ~/.bash_aliases file. Yes, that can work, but using ~/.bashrc is the standard. The ~/.bash_aliases file is an Ubuntu addition which is explicitly sourced by the ~/.bashrc file, but the normal config file is ~/bashrc. | |
| Mar 13, 2022 at 11:46 | answer | added | terdon♦ | timeline score: 6 | |
| Mar 13, 2022 at 10:43 | comment | added | Chris Davies | Possible duplicate - Quick directory navigation in the bash shell | |
| Mar 13, 2022 at 10:23 | comment | added | weygoldt | @they other functions would be to path the path to an rsync command to eventually backup my stuff to an external drive (once I have time to write up a script to leave the gui application I currently use). You are completely right, using a variable is probably the sane way to do this, which I haven't thought about yet since this is really the first time I mess with my bash configuration. Can variables also live in the .bashrc_aliases file? | |
| Mar 13, 2022 at 10:16 | comment | added | fra-san | Relating, though not an exact answer: unix.stackexchange.com/q/25327/315749 | |
| Mar 13, 2022 at 10:15 | comment | added | Kusalananda♦ | What are the other functions you would want to use with the pathname? Have you considered putting the pathname in an ordinary variable (unipath=/mnt/data/uni) and then using something like alias uni='cd "$unipath"'? That would give you an alias for the cd command with your path, as well as a variable that you could use with other functions. I'm not turning this into an answer as you have not said anything about what other things you need to do that stop you from using an alias the way one usually does. | |
| S Mar 13, 2022 at 9:58 | review | First questions | |||
| Mar 13, 2022 at 12:48 | |||||
| S Mar 13, 2022 at 9:58 | history | asked | weygoldt | CC BY-SA 4.0 |