Contribute
Register

How to rename USB hardware device name such as Serial Adapter?

Status
Not open for further replies.
Joined
Mar 27, 2017
Messages
2
Hello all!
I use the built-in terminal command screen to connect to devices through my FTDI USB to RS232 serial adapter.
It works great and I'm having no functionality issues. To connect I use:
screen /dev/tty.usbserial-AJ03IZPF 9600

It would be nice to not have to enter the serial number each time. Is there a way to rename attached USB hardware so it could be shortened to:
screen /dev/tty.usbserial 9600 or if it has to be unique at the end something like: screen /dev/tty.usbserial-1 9600

I've done a fair amount of Googling and came up with nothing. You guys are the hardware experts so I figured I'd give it a shot.

MBP 2016, MacOS 10.12.3
 
So I also posted this up at ExpertsExchange and got a few different answers I'll share here in case anyone else is interested. The symlink (as nobodynose has mentioned above) is a valid option although it won't let you create it inside dev/. What I did was create a new folder at root called 's' (for symlinks) and successfully created the symlink:
Code:
$ sudo ln -s /dev/tty.usbserial-AJ03IZPF /s/tty
this allows me to connect using:
Code:
screen /s/tty 9600

Another cool method that was suggested was creating an alias for the entire command:
Code:
alias usbserial="/usr/bin/screen /dev/tty.usbserial-AJ03IZPF 9600"
and then making that alias permanent:
Code:
echo 'alias usbserial="/usr/bin/screen /dev/tty.usbserial-AJ03IZPF 9600"' >> ~/.bash_profile
this allows you to run the entire command and make the connection by just typing: usbserial
 
Status
Not open for further replies.
Back
Top