Linux commands and telnet

Posted on 2014-09-11
Last Modified: 2014-09-12
I have connected to a barcode scanner through telnet command and was able to sign into root with correct password at the # prompt I "cd /mnt" then I did a "ls" command and it lists the files in this directory (file1 file2 file3). When I do a "dir" command I get the following:
-sh: dir: not found
When I done this on two other scanners I was able to do a "dir" command and list the contents of the directory like this:
dir (enter)
All scanners are the same model number
I could not find anything on what -sh: dir: not found means.
Can anyone guide me here.
Linux 2.6.99
Question by:dkma2010
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
LVL 12

Expert Comment

by:Kent W
ID: 40318384
It sounds like /bin is in your path, but /usr/bin is not.  
Whatever user you are logging in as, in your home directory, edit the file -

In it you will see a line similar to

Add :/usr/bin to this, so it looks like

Log out, then log back in.
LVL 84

Expert Comment

ID: 40318386
Is there something you want to do with dir that you can't do with ls?

Author Comment

ID: 40318403
I used dir as an example. The instructions I was using instructed me to do the dir command to see the files then once the files were verified use the put command PUT c:\xxx\file1 file1 but this gave the same problem I mentioned earlier. I figured it was a rights issue or something because it did work on two of them before I ran into this problem. I thought I must be doing something wrong.
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 24

Expert Comment

ID: 40318405
dir is not a standard unix command. sh is not usually an interactive shell, so it's probably symlinked to something else, possibly bash, possibly something else. As ozo asked, what are you trying to do?
LVL 24

Accepted Solution

mankowitz earned 500 total points
ID: 40318406
wait... dir is a standard FTP command, as is PUT. Are you using ftp?
LVL 84

Expert Comment

ID: 40318413
You wouldn't get
-sh: dir: not found
using ftp, unless you said !dir
LVL 12

Expert Comment

by:Kent W
ID: 40318428
Telnet does not support file transfer.  The PUT is indeed an ftp command.
It will work regardless of if your "dir" command is working.  "ls" will do the same thing (list the files / directories).

Author Closing Comment

ID: 40319137
Okay I guess it was a long day. Indeed I was using telnet instead of ftp. When ftp was mentioned it dawned on me I kept using the telnet command. Once I settled my brain down and actually followed the instructions using FTP then it worked. I can't believe that. Well at least it was a learning experience.

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question