Homebrew Corrupts PATH Variable on OSX Maverick - shell

A failed attempt to install a Homebrew package on a Maverick OSX Macbook Pro was terminated by a Cntrl-C process break. Afterwards, the ZSH shell profile is corrupted such that :
uname
zsh: command not found: uname
man
zsh: command not found: man
ps
zsh: command not found: ps
cat
zsh: command not found: cat
echo $PATH
/usr/sbin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/local/sbin:PATH:/usr/local/opt/curl/bin
/Users/..../.rvm/scripts/rvm:12: command not found: uname
/Users/.../.rvm/scripts/rvm:15: command not found: ps
npm --version
5.5.1
parse_git_dirty:11: command not found: tail

add /usr/bin to your PATH first
export PATH=/usr/bin:$PATH

Related

.zshrc corrupted. terminal doesn't excecute commands. "spaceship_exec_time_preexec_hook:2: command not found: date zsh: command not found: ls"

PLEASE HELP!
changed order of oh-my-zsh in ~/.zrshrc lines (put them at the end of the file due to some other req from anoter software), saved, closed and reopen terminal and for each command excecuting termnial or iterm - there's the same error response!!
even simple command do not work and generate the same output.
upon openning the terminal i see those lines (before typing anything):
nvm:7: command not found: tr
nvm:7: command not found: tr
/Users/user/.oh-my-zsh/oh-my-zsh.sh:69: command not found: rm
compdump:136: command not found: mv
detect-clipboard:33: command not found: uname
/Users/user/.rvm/scripts/rvm:12: command not found: uname
/Users/user/.rvm/scripts/rvm:29: command not found: ps
spaceship_jobs:3: command not found: awk
spaceship_jobs:3: command not found: wc
spaceship_jobs:3: command not found: tr
tried :
nano .zshrc
output:
spaceship_exec_time_preexec_hook:2: command not found: date zsh: command not found: nano spaceship_jobs:3: command not found: awk spaceship_jobs:3: command not found: wc spaceship_jobs:3: command not found: tr
tried:
nano .bash_profile
output:
spaceship_exec_time_preexec_hook:2: command not found: date zsh: command not found: nano spaceship_jobs:3: command not found: awk spaceship_jobs:3: command not found: wc spaceship_jobs:3: command not found: tr
even simple ls command:
output:
spaceship_exec_time_preexec_hook:2: command not found: date zsh: command not found: ls spaceship_jobs:3: command not found: awk spaceship_jobs:3: command not found: wc spaceship_jobs:3: command not found: tr
using macOS bigsur 11.4
thanks

zsh: command not found: mkfs on macOS

Hi i entered it in terminal macOS
dd if=/dev/zero of=img.1440 bs=1k count=1440
mkfs img.1440
And got this error
zsh: command not found: mkfs
mkfs is a Linux command, but if you have Homebrew installed, you can install e2fsprogs:
brew install e2fsprogs
Then run mkfs.ext3:
$(brew --prefix e2fsprogs)/sbin/mkfs.ext3 img.1440

Mac OS X /usr/bin/time verbose flag

I have been trying to run the usr/bin/time command in my terminal (Bash) with the verbose flag --verbose or -v but have repeatedly been getting this error:
/usr/bin/time: illegal option -- v
usage: time [-lp] command.
The command I have been running looks like basically like this:
/usr/bin/time -v python practice.py
Any ideas how to get this to work properly on a Mac? (I have OS X Yosemite)?
If you have homebrew, you can get GNU time by installing the gnu-time package:
brew install gnu-time
After that, it’s available as the gtime command:
$ gtime
Usage: gtime [-apvV] [-f format] [-o file] [--append] [--verbose]
[--portability] [--format=format] [--output=file] [--version]
[--help] command [arg...]
The case is similar for a lot of other homebrew-packaged GNU utilities for OSX; e.g., you can get the GNU df command with gdf, du with gdu, readlink with greadlink, etc.
The homebrew package that has most of those is coreutils, which installs about a hundred different GNU-flavored commands. Other useful packages: findutils, gnu-sed, gnu-tar.
If you don’t have homebrew installed yet, you can get it with just a single command:
Command to download and install homebrew
ruby -e "$(curl -fsSL\
https://raw.githubusercontent.com/Homebrew/install/master/install)"
I think looking at the man page the verbose flag is GNU only. Unfortunately, OSX implementation simply differs.

Trouble Installing Homebrew on Mac

I am having trouble installing Homebrew on a mac. I am running Mac OS X 10.8.4.
When I try to install it through
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
Or:
ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
I get:
\-bash: curl: command not found
-bash: ruby: command not found
I have also tried:
cd /usr/local/bin
mkdir homebrew && curl -L https://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C homebrew
And got:
-bash: mkdir: command not found
What do you think may be wrong>

When I type $ gcc into the mac Terminal I get a "-bash: gcc: command not found"

However, it works when I type:
$ gcc-4.2
Find where gcc-4.2 is installed and go into that directory:
$ cd $(which gcc-4.2)
Check if there is a gcc symlink:
$ ls gcc
If there isn't one, create it:
$ ln -s gcc-4.2 gcc
I got it: all was well after I installed command line tools in Xcode > Preferences > Downloads.

Resources