Tag Info

New answers tagged


Use which tmux && export TERM=xterm-256color && exec tmux If there is tmux, which tmux will evaluate to path to tmux binary, therefore to true. If there is no tmux, it will evaluate to empty string, so to false.


Ok, so if you want to start tmux only when it exists in $PATH and when it isn't already running then you can do: command -v tmux >/dev/null && ${TMUX+:} TERM=xterm-256color exec tmux Shorter still: tmux -c "${TMUX+!} :" 2>/dev/null && exec tmux -2 The second one asks tmux to return 0 if ${TMUX} is not set && if true, the ...


Did you do echo $TMUX, while in a tmux session? Because TMUX is only set, when in a session. Try that instead: [ -z "$TMUX" ] && command -v tmux >/dev/null && TERM=xterm-256color exec tmux


You can almost definitely just do: alias >>./bash_aliases


Easy trick for alias in $(compgen -a); do type $alias; done


Why are the SSH variables set? It is likely that the variables are set because your VNC connection is tunneled through an SSH connection. There are good reasons to do this. VNC uses the RFB protocol which is not secure. Tunneling VNC through SSH improves security. Why is the SSH_CONNECTION variable the same? The SSH_CONNECTION variable consists of four ...


-o comm= means user output should be the command name only, but without any column title. E.g. if you do -o comm=COMMAND, it will print you a column title COMMAND: $ ps -o comm= -p $PPID xterm $ ps -o comm=COMMAND -p $PPID COMMAND xterm -p $PPID selects the process by the given parent's PID, the PPID. That means -o comm= -p $PPID are two independent ...


# rm /etc/bash.bashrc # apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall bash I hit those two commands up Reinstallation of bash is not possible, it cannot be downloaded. I am on a ubuntu 14.04


To restore your /etc/bash.bashrc to its original state (if you can't remember what that is), you can do: sudo rm /etc/bash.bashrc sudo apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall bash Otherwise @aprad046's answer seems like the best solution.


Try restoring bash.bashrc to its default setting, and edit your local copy of PATH in your ~/.bashrc file instead. In other words, put those last two lines: export PATH=$PATH:/usr/lib/jvm/jdk1.7.0_60/bin/ export JAVA_HOME=$JAVA_HOME:/usr/lib/jvm/jdk1.7.0_60/bin/java/ in your ~/.bashrc file instead of /etc/bash.bashrc. You might have to restart for changes ...

Top 50 recent answers are included