Solved

Linux commands and telnet

Posted on 2014-09-11
8
402 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

760 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

22 Experts available now in Live!

Get 1:1 Help Now