Solved

Linux commands and telnet

Posted on 2014-09-11
8
404 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
  • 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
 
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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now