0

On my macbook pro, I'm trying to create a quick command to check my home internet speed.

This website provided the command I use :

curl -O http://speedtest.wdc01.softlayer.com/downloads/test10.zip > /dev/null

I'd really not like to type this command every time so I created an alias called "ispeed" by running

Users-MacBook-Pro:~ user$ sudo nano /.bash_profile

enter image description here

However, when closing terminal and opening a fresh one, I try the new command:

Users-MacBook-Pro:~ user$ ispeed

and get the following:

-bash: ispeed: command not found

How to fix?

3
  • 1
    /.bash_profile is not the same as ~/.bash_profile. Commented Apr 18, 2016 at 1:44
  • @Benjamin W But I was in my home folder? What changes when I put a "~" in front? Commented Apr 18, 2016 at 14:30
  • /.bash_profile is an absolute path to the file .bash_profile in the root folder, / (and that file doesn't exist), so no matter where you are, it'll will try to find it in the root folder. ~/.bash_profile is also an absolute path, but to your home folder, where the file actually is. Commented Apr 18, 2016 at 15:00

1 Answer 1

2

Put the alias command in ~/.bash_profile:

alias ispeed='curl -O http://speedtest.wdc01.softlayer.com/downloads/test10.zip > /dev/null'

And then, make sure to write it out correctly (Save the file). After you properly save the alias and nano or whatever text editor you're using is exited, you should get your command prompt line back. It won't work in that shell though, you need to open a new one. Press cmd + t to open a new tab and then try the command ispeed and it should work.

Sign up to request clarification or add additional context in comments.

1 Comment

this did it, thanks!