0

I have been working at this company for around 8 years now and something that has always puzzled me is that we have a software supplier who often connects to our network to provide user support on their software to our users etc.

My question is when they need to connect to our server I have noticed that they run these commands on their desktop to access our server:

$ modem1
$ internet
$ take EUUK_9010

I take it EUUK_9010 is our customer number to them or something, but what do the other commands do? This seems to be the equivalent of them opening up a terminal and writing ssh root@our.ip, why don't they just do that?

Jack
  • 121
  • They all look like aliases / functions; if using bash you can look for their definition in /etc/bashrc or in ~/.bashrc – kos Sep 02 '15 at 08:38
  • ... Or local scripts (or executables) – Jeff Schaller Sep 02 '15 at 09:03
  • If it's an executable file, try which modem1 and if it's a shell script, you can just read what it does. A respectable command should have a man page, or at least --help switch (or something like that). However, as these are nonstandard (never heard of) commands, probably made specifically for some local purpose, they probably don't follow the common agreements about input argument parsing, documentation and so on. – orion Sep 02 '15 at 09:45
  • 1
    whichis a cs script and only works if you are using the csh. If you use a standard compliant shell, the command you like to use is rather type that will tell you whether a command argument is an alias, a built-in command an external filesystem based program or unknown. – schily Sep 02 '15 at 10:03
  • which is a binary executable, included in all unix-based systems I've seen so far, and thus available to all shells. type is a shell builtin (which actually does more than which, because it detects also builtins and functions), intended for human-readable output (if you are looking where the executable is, use which, especially in a script). There may be shells that don't have type, but which will still be there. – orion Sep 02 '15 at 10:18

1 Answers1

3

None of these commands are standard Unix ones so they can be anything.

First have a look to what the shell is actually calling when they are run:

$ type modem1

Type will likely tell the queried command is an alias, a function, or an executable file.

In the latter case, you can use the file command to figure out if it is a shell script or a binary, eg:

$ file /usr/bin/modem1

Note: To figure out what will eventually be executed when you enter a command under a POSIX or Bourne shell (e.g. sh, ksh, zsh, bash, ash, dash, etc.), make sure you use the type command and not the which one. The latter is not specified by POSIX so might be missing from a Unix system. Moreover, the which executable often present in Unix/Linux systems will give useless information when a command present in the PATH is overridden by an alias or a function. You only want which if you use a csh family shell like tcsh.

jlliagre
  • 61,204