Benches macOS

6

Getting the nc (netcat) command to work i…

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

I cannot get the nc command to work in the Terminal. I type in a command and it just gives me the syntax for the command.

I have tried to do sudo su and it doesn't make it work either.

The strange thing is is that it worked fine for me on Tiger.

The command i was doing was "nc -vlp port."

6 replies

Sign in or join Beachball Help to reply.

  1. 0

    red_menace

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Some of the shell scripts have been changed/updated with Leopard, but the current man pages installed with the OS should also have been changed/updated. If there is a conflict, usually Apple's online Mac OS x Manual Pages reference will have the correct information. Netcat works for me - if you check the current nc man page, you will find that the "l" and "p" options cannot be used together.

  2. 0

    omgiamso1337

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Whoops, I think i double posted (I didn't see an edit button for my last post).

    I just tested the command that you suggested, and it worked (i think, but it didn't say listening, it just was blank, so i believe it was working). I looked on the man pages and didn't see the -e function and I remember the "new" nc saying "illegal option -e." I was wondering how to send something over to another computer running nc, like a shell.

  3. 0

    omgiamso1337

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    so there is no workaround to listen on a certain port on nc?

  4. 0

    red_menace

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    No workaround needed - try nc -vl port (where "port" is your port number).

  5. 0

    omgiamso1337

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Thanks, i'll test it out. I guess I should have looked a little harder at the man page.

  6. 0

    red_menace

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    There is also a simple example of that on the man page under Client/Server Model.