Category: Bash

git 0

error: pathspec did not match any file(s) known to git

Have you encoun­tered the fol­low­ing error while check­ing out a branch. error: path­spec ‘foo’ did not match any file(s) known to git. Solu­tion: git fetch It will syn­chro­nizes your local repos­i­tory with the remote…

Gnu-bash-logo 0

Bash scripting missing ’]’

If you have the sim­ple script like the fol­low­ing : #!/bin/bash if [ $foo = ‘bar’]; then echo ‘Foo is equal to bar’ fi And when you run the script, if you get the…

Gnu-bash-logo 0

How to create scripts in terminal

Fol­low three sim­ple steps to auto­mate your ter­mi­nal. Cre­ate a script Set the per­mis­sions Exe­cute the script Cre­ate a script test.sh $vi test.sh ls –la echo ‘Hello Bash!’ Set the per­mis­sions $sudo chmod 777…