48 votes

What does `>>` mean in terminal command?

Short answer — what does >> do? With >>, you append the output of a command to a file. Your example command consists of several parts, basically: command >> filename So the output of ...
slhck's user avatar
  • 228k
31 votes
Accepted

What does `>>` mean in terminal command?

It redirects the stdout of the program before >> and appends it to the given file after.
kai-dj's user avatar
  • 482
28 votes

Difference between .bashrc and .bash_profile

Have a look at this excellent blog post by ShreevatsaR. Here's an extract, but go to the blog post, it includes an explanation for terms like "login shell", a flow chart, and a similar table for Zsh. ...
Flimm's user avatar
  • 10.7k
13 votes

bash how to remove "__bp_precmd_invoke_cmd" error?

Using an editor such as nano or vim, Add the line unset PROMPT_COMMAND to your .bashrc file, and it will take effect on the next session. To apply the change immediately for the life of the ...
Simon B's user avatar
  • 417
13 votes
Accepted

`ssh <host>` is a login shell, but `ssh <host> <command>` is not?

OpenSSH (most likely what you're running) decides whether or not to create a login shell, and it only does so if you are not running a specific command. From man ssh: If command is specified, it is ...
Eric Renouf's user avatar
  • 1,754
11 votes

Difference between .bashrc and .bash_profile

A BETTER COMMENT FOR THE HEAD OF /ETC/PROFILE Building on Flimm's great answer above, I inserted this new comment at the head of my Debian /etc/profile, (you might need to adjust it for your distro.): ...
Elliptical view's user avatar
11 votes

Visual studio code integrated terminal path different than normal terminal

In Visual Studio Code open Settings (JSON) from the command palete (⇧⌘P), and at the end of the file add the following "terminal.integrated.env.osx": { "PATH": "" } Restart VSCode and you ...
diegouis's user avatar
  • 111
10 votes

Difference between .bashrc and .bash_profile

The configuration logic of bash's itself is not crazy complicated and explained in other answers in this page, on serverfault and in many blogs. The problem however is what the Linux distributions ...
MarcH's user avatar
  • 431
9 votes

How can I fix a Broken Pipe error?

Let's try with yes, an endless process printing yes... Before, the yes process was killed by SIGPIPE when reached limit. ➜ set -o pipefail ➜ yes | head -n 1 y ➜ echo $? 141 My solution ➜ ...
Miao1007's user avatar
  • 191
9 votes
Accepted

Win10: VS Code integrated bash not loading ~/.bash_profile

Turns out, that it had to do in how the terminal is started. The git bash one (in its own window) is using the login to start and hence reads .bash_profile. The one in vs code is started not in the ...
LLL's user avatar
  • 303
7 votes

~/.profile is not loaded when using SSH (Ubuntu)

You probably have a ~/.bash_profile, which overrides ~/.profile.
user541686's user avatar
  • 23.9k
7 votes
Accepted

How to load parts of bash alias only when logging in via ssh

In .bashrc (or where you define the aliases), you can make it conditional based on the variable SSH_CONNECTION, which is set only for ssh connections. For example: if [[ $SSH_CONNECTION == *"your-IP"*...
Jakuje's user avatar
  • 10.3k
7 votes

What does `>>` mean in terminal command?

For the TLDR people who just like to see an example; The standard output (not errors) of the command before the >> will get added to the end of the file named after it. So if file "flintstones.txt" ...
Mark Boyce's user avatar
7 votes

How to read excel using Powershell

In Powershell, you can use the great ImportExcel module to handle all sorts of excel data: # First-time setup, install the module: Install-Module ImportExcel # Import the module: Import-Module ...
Cpt.Whale's user avatar
  • 7,671
5 votes
Accepted

.bashrc running an alias without my approval: fatal: Not a git repository (or any of the parent directories): .git

The specific subcommand style doesn't make any difference – either way, as long as they're within double quotes, they'll be expanded at the time the 'alias' line is interpreted. To avoid that, either ...
u1686_grawity's user avatar
5 votes

How do I modify my Git Bash profile in Windows?

My git version is git version 2.18.0.windows.1 It took me a while to figure out where the .bashrc was C:\Program Files\Git\etc ---> bash.bashrc hope it helps
SalFie's user avatar
  • 51
5 votes

How to reset Bash on Mac OSX, .bash_profile corrupted and bash no longer works

I was running on the same problem, and I just found simpler solution: /usr/bin/nano .bash_profile delete all your mess, then save the file
Fajar Ulin Nuha's user avatar
5 votes

Win10: VS Code integrated bash not loading ~/.bash_profile

You can try adding to the settings: "terminal.integrated.shellArgs.windows": ["-l"], As an alternative you can use the .bashrc file instead of .bash_profile.
Victor S.'s user avatar
  • 349
5 votes

Visual studio code integrated terminal path different than normal terminal

You can uncheck Terminal › Integrated: Inherit Env option, which can be searched by terminal.integrated.inheritEnv, in Visual Studio Code Settings like the following image: Referece: https://github....
Gorisanson's user avatar
5 votes

Git Bash extremely slow start up on Windows

In my case I was using MING64 with Git bash for Windows. It took a solid 15 seconds to load every window. It turns out the .bashrc in %USERPROFILE% was the culprit. I had NVM installed on my system ...
Chris L's user avatar
  • 51
4 votes

`ssh <host>` is a login shell, but `ssh <host> <command>` is not?

The why of this behavior lies at a lower level than shells: ssh host (the "login shell" case) uses a pseudoterminal on the remote host, to communicate between the sshd server process and the shell; ...
zwol's user avatar
  • 1,278
3 votes

How can I fix a Broken Pipe error?

The write error: Broken pipe message refers to a writing process that tries to write to a pipe with no readers left on the reading end of that pipe and the special circumstance that the SIGPIPE signal ...
zancox's user avatar
  • 31
3 votes
Accepted

Screwed up PATH in ~/.bash_profile, now cannot edit it

/bin/nano ~/.bashrc or /usr/bin/emacs ~/.bashrc or /usr/bin/vim ~/.bashrc
Ipor Sircer's user avatar
  • 4,103
3 votes

.bashrc not automatically initalising?

I'm not sure if I understand your questions but: Your bash init files should be sourced at boot. If not your system is badly configured or broken. You didn't mention your Operating System, but I'm ...
Alexandro de Oliveira's user avatar
3 votes

Can't export variable in .bash_profile ubuntu 18.04

For your reference: Below is login shell startup file processing diagram for different shells (Credit for diagram is going to Shantanu Kulkarni who posted it in yEd gallery)
Alex's user avatar
  • 6,227
2 votes

MinGW Bash profile

Along the lines of @Koshmarr, but slightly different. My mingw64, downloaded from git-scm.com, would load /c/Users/[user-name] on startup. Yet my home drive (found by cd ~) was in /h/. I put a .bashrc ...
RAFisherman's user avatar
2 votes
Accepted

Execute same command for each non-interactive bash session

To make bash parse a file when invoked as a non-interactive shell, you need to set the environment variable BASH_ENV to point to that file. From man bash (section on INVOCATION): When bash is ...
Shevek's user avatar
  • 121
2 votes

How can you remove duplicates from bash history?

Many more ways to do this here as well as some other ongoing settings / options: https://unix.stackexchange.com/questions/48713/how-can-i-remove-duplicates-in-my-bash-history-preserving-order Also ...
social's user avatar
  • 131
2 votes

How can you remove duplicates from bash history?

I've created a small Python script deduplicate.py for this. If a line is duplicated, the script only keeps the last duplicate. This works nicely when searching the command history with fzf using Ctrl+...
Matthias Braun's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible