Tagged: cli

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…