bashrc

Bash alias for removing docker images does not use force flag

Bash alias for removing docker images does not use force flag Currently I have an alias to force remove images, the command is something like: docker rmi $(docker images | grep pattern | grep -v other_pattern | tr -s ‘ ‘ | cut -d ‘ ‘ -f 3) -f Within my ~/.bashrc it looks like: …

Total answers: 1

Which environment variable controls the location of .local directory?

Which environment variable controls the location of .local directory? Due to storage space constraints in my home directory, I need to move as much out of there as possible. I have moved caches and configs out by setting the $XDG_CACHE_HOME and $XDG_CONFIG_HOME directories. However, I cannot find the proper environment variable to set in order …

Total answers: 1

How to "source ~/.bashrc" automatically when connect to remote

How to "source ~/.bashrc" automatically when connect to remote I need to create some aliases on remote Ubuntu and enable them on ssh-connection. So I defined aliases in ~/.bashrc file (on that remote Ubuntu). Now when I do ssh root@<Remote IP> source ~/.bashrc I can use those aliases… But instead of do source ~/.bashrc manually …

Total answers: 1

How to add code to .bashrc without causing errors?

How to add code to .bashrc without causing errors? I’m learning how to passthrough my NIC to my KVM. This guide says to add the following code to the file ~/.bashrc #!/bin/bash # change the 999 if needed shopt -s nullglob for d in /sys/kernel/iommu_groups/{0..999}/devices/*; do n=${d#*/iommu_groups/*}; n=${n%%/*} printf ‘IOMMU Group %s ‘ "$n" lspci …

Total answers: 1

how to add alias to bashrc and load content with sudo?

how to add alias to bashrc and load content with sudo? I need to run my script with sudo, because it includes commands for installing programs with apt. So I do this: sudo ./myscript.sh With content: #!/bin/bash # add alias .bashrc (work) echo "alias myupgrade=’sudo aptitude -y safe-upgrade && sudo updatedb’" | sudo tee -a …

Total answers: 1

Alias path not found on Ubuntu

Alias path not found on Ubuntu I installed kind from kubeflow kind and save it under my $HOME/kubeflow/kind To run kind from any path, I create an alias in my ~/.bashrc as following: alias kind="./$HOME/kubeflow/kind" source ~/.bashrc When running kind on the terminal, it throw this error: -bash: .//home/XXXX/kubeflow/kind: No such file or directory What …

Total answers: 2

Can't Create a Permanent Alias In Fish Shell

Can't Create a Permanent Alias In Fish Shell I’m trying to create a permanent alias. I’ve created one long ago, but I don’t remember if I did anything differently than what I’m doing now. Be as it may, it isn’t working! I start by opening the terminal and type nano ~/.bashrc Then I scroll to …

Total answers: 1

export PATH="/usr/bin:$PATH" needed for every single command

export PATH="/usr/bin:$PATH" needed for every single command so I was trying to set JAVA_HOME variable and some how I ended up facing this error every time I want to use terminal Command ‘poweroff’ is available in the following places * /sbin/poweroff * /usr/sbin/poweroff The command could not be located because ‘/sbin:/usr/sbin’ is not included in …

Total answers: 3

bash: /home/vishal/.bashrc: Errors when opening terminal

bash: /home/vishal/.bashrc: Errors when opening terminal Everytime I open my terminal , this message pops up. Please tell how to permanently delete this from the terminal? bash: export: `=’: not a valid identifier bash: export: `/home/vishal/LLVM/llvm-project-llvmorg-12.0.0/build/bin’: not a valid identifier C: command not found C: command not found C: command not found C: command not …

Total answers: 1

Terminal is not spitting output after messing with ~/.bashrc file

Terminal is not spitting output after messing with ~/.bashrc file My Terminal Image: I’m using Ubuntu with WSL and can’t access GUI. Aforementioned images of my terminal, no output is displaying for anything I type. Terminal is acting like an editor. It happened after I edited PS1 variable. I want to revert this action. Asked …

Total answers: 2

Changing bash terminal color and setting it back to default?

Changing bash terminal color and setting it back to default? I found this command to change the background color to back: echo -ne ‘e]11;#000000e\’ So, how to I make it to change the default again? Thanks :3 Asked By: Adrián Núñez Martínez || Source The idea is to replace the #000000 with the color of …

Total answers: 3

What goes in ~/.profile and ~/.bashrc?

What goes in ~/.profile and ~/.bashrc? I’m having trouble wrapping my head around what belongs in ~/.profile and what belongs in ~/.bashrc. From what I’ve read, it seems to me that ~/.profile should be used for environment variables and ~/.bashrc for aliases, functions, and the like. If I move all my export statements from ~/.bashrc …

Total answers: 3

Bash: Define a function in bashrc that can be used by any scripts globally

Bash: Define a function in bashrc that can be used by any scripts globally I like to define a function in ~/.bashrc and use it in different scripts either via export -f or source .bashrc. The function: nano ~/.bashrc function test_func() { yt-dlp -f ‘299+140’ –merge-output-format mp4 -cia List.txt; } export -f test_func The script: …

Total answers: 2

Bash no such file or directory every time I open the Ubuntu terminal

Bash no such file or directory every time I open the Ubuntu terminal I am new to Ubuntu. I was trying to add: echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc Then I reloaded .bashrc with: source ~/.bashrc Now I am stuck with this. Every time I start terminal I get this first: bash: /catkin_ws/devel/setup.bash: No such file …

Total answers: 1

bash does not know the letter 'p'

bash does not know the letter 'p' My bash does not know the letter p. zsh does though. When I type a p in bash, it simply ignores it, and even pasting in text that contains a p will result in no p in the pasted text. This behavior is the same across terminals (I …

Total answers: 1

Zsh coloring like bash

Zsh coloring like bash I want my zsh shell to look exactly like bash shell(in terms of default coloring) but my zsh shell’s text is plain white. I identified this part of .bashrc which I think adds the green color to user@pc: if [ “$color_prompt” = yes ]; then PS1=’${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[00m]$ ‘ else PS1=’${debian_chroot:+($debian_chroot)}u@h:w$ ‘ fi …

Total answers: 2

How can I use an alias in a function?

How can I use an alias in a function? In my dotfiles I have some functions that rely on aliases or functions to exist for them to work. For some reason, I can get them to reference other functions I have created, but not aliases for commands. How do I fix this? Example: function open-dotfiles-commit(){ …

Total answers: 2