Solved

Linux commands and telnet

Posted on 2014-09-11
8
409 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

828 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