Score:2

What does dev mean in linux commands?

de flag

I have been experimenting with Linux recently and I've come across a dev argument in some commands when dealing with networks. E.g.:

  • ip link set dev wlan0 up/down
    
  • ip link set dev wlan0 address XXX
    
  • nmcli dev show wlan0
    

The ip link commands seem to work without the dev argument as well. For nmcli I think it lets the system know that I'm talking about a device, and I guess that it has a similar purpose for ip link. I'm slightly confused why it's there if it works without it though.

Did ip used to need it, but now it's "smarter" or is it something different?

Score:8
na flag

For the ip command dev has no meaning. Most likely it was used as an example in the context of having to specify the actual device on which the ip command should work (like wlan0).

In the nmcli command dev is a shortcut for specifying the full option name device in the command.

hr flag
Although the man page doesn't appear to mention it, the built-in help (`ip link help`) gives the syntax of the `link set` command as `ip link set { DEVICE | dev DEVICE | group DEVGROUP } ...` so it looks like `dev` is a kind of "optional keyword" in this context
Score:1
us flag

dev is shorthand for device

in this case, as has been suggested, it may be a placeholder for the device you are looking to perform operations on

when in doubt, I suggest finding via Google a few other examples of the command in question, that normally tells you whether the argument is a placeholder or actually part of the instruction.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.