Solved

Linux commands and telnet

Posted on 2014-09-11
8
410 Views
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)
file1
file2
file3
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
0
Comment
Question by:dkma2010
[X]
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
8 Comments
 
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 -
.bash_profile

In it you will see a line similar to
PATH=$PATH:$HOME/bin

Add :/usr/bin to this, so it looks like
PATH=$PATH:$HOME/bin:/usr/bin

Log out, then log back in.
0
 
LVL 84

Expert Comment

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

Author Comment

by:dkma2010
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.
0
Independent Software Vendors: 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

by:mankowitz
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?
0
 
LVL 24

Accepted Solution

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

Expert Comment

by:ozo
ID: 40318413
You wouldn't get
-sh: dir: not found
using ftp, unless you said !dir
0
 
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).
0
 

Author Closing Comment

by:dkma2010
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.
0

Featured Post

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!

Question has a verified solution.

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

Suggested Solutions

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

740 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