Tagged: bash

Windows-10 0

How to sudo in windows

There is no sudo com­mand in win­dows. But you can run the com­mand prompt with admin priv­i­leges by right click­ing the it and select­ing run as administrator.

Gnu-bash-logo 0

Autocomplete cli from history

Use the fol­low­ing steps to do the reverse search in your bash his­tory. $ Ctrl + R $(reverse-i-search)‘’: [start typ­ing com­mand…] [Tab/Enter] — Tab will com­plete the com­mand and brings back the CLI. -…

mac-apple-logo 0

pipe the output to the file

When you want to save the ter­mi­nal logs into an exter­nal file, use the fol­low­ing com­mand. <com­mand> 2>&1 | tee foo.txt Replace, the com­mand with your com­mand. For exam­ple, grunt unittest More details about…

Gnu-bash-logo 0

$? variable in linux

$? Sta­tus of the pre­vi­ous process / com­mand which ran on the shell $ pwd $ echo $? // returns 0 which means the pre­vi­ous com­mand ran sucess­fully $ blah­Com­mand $echo $? // returns 1…

ubuntu-icon 0

rename extension of multiple files linux

I recently wanted to rename all my jpg files to png files in one folder on my ubuntu device. The fol­low­ing com­mand did the trick for me. rename ‘s/.jpg$/.png/’ *.jpg

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…