Skip to content

Useful Commands


Reload .profile to Modify Corrupted .bashrc


If something went wrong with the .bashrc file (and sourced it), such as:
The misapplied export command for exporting a path causes the path leads to nowhere and resulted in command not found.

Type in the following command to reload .profile:

#
. ~/.profile

Then open the editor to modify the .bashrc file:

terminal
vim ~/.bashrc

Remove the line inside .bashrc that causes the problem, and source it again.

terminal
source ~/.bashrc

Cannot Execute Shell File Using ./


Considering modifying the Bash Shebang #!.

Instead of using the absolute path to the bash binary:

*.sh
#!/bin/bash

Use the env utility:

*.sh
#!/usr/bin/env bash
Published inCS Experiment

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *