LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Running bash but common bash commands not working (https://www.linuxquestions.org/questions/linux-newbie-8/running-bash-but-common-bash-commands-not-working-820350/)

michellepace 07-17-2010 03:43 AM

Running bash but common bash commands not working
 
Hi there, below are the details of my system. I have bash as my current shell, some really common commands aren't working. Please see below.

Do I need to do a re-installation of bash? Or how do I install a selection of bash commands which I need? (for example a subset of http://ss64.com/bash/)

Code:

root@sdptfw:~ # uname -a
Linux sdptfw.sdpt.co.za 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$
/bin/bash$

root@sdptfw:~ # man uname
-bash: man: command not found
root@sdptfw:~ # clear
-bash: clear: command not found

root@sdptfw:~ # cat /etc/bashrc
cat: /etc/bashrc: No such file or directory

root@sdptfw:~ # cat /etc/profile
# /etc/bashrc

umask 022
unset i

# are we an interactive shell?
if [ "$PS1" ]; then
    if [ -x /usr/bin/tput ]; then
      if [ "x`tput kbs`" != "x" ]; then # We can't do this with "dumb" terminal
        stty erase `tput kbs`
      elif [ -x /usr/bin/wc ]; then
        if [ "`tput kbs|wc -c `" -gt 0 ]; then # We can't do this with "dumb" terminal
          stty erase `tput kbs`
        fi
      fi
    fi
fi

# Path manipulation
PATH="/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin"

# No core files by default
ulimit -S -c 0 > /dev/null 2>&1

USER=`id -un`
LOGNAME=$USER

HOSTNAME=`/bin/hostname`
HISTSIZE=250

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
    INPUTRC=/etc/inputrc
fi

export PATH USER LOGNAME HOSTNAME HISTSIZE INPUTRC

# LS Colors
alias dir='ls'
alias ll='ls -l --color=tty'
alias ls='ls --color=tty'

# IPCop language settings
LANG=en_US.utf8
PS1='\[\033[1;33m\]\u\[\033[1;37m\]@\[\033[1;32m\]\h\[\033[1;37m\]:\[\033[1;31m\]\w \[\033[1;36m\]\$ \[\033[0m\]'
echo -n -e '\033%G'

export LANG PS1

thank-you
michelle

zirias 07-17-2010 04:27 AM

Those are not bash commands but seperate programs. You are just missing the /usr/bin/man and /usr/bin/clear binaries. How you install them depends on your distribution.

grail 07-17-2010 04:52 AM

I see no problems with any of the commands issued.
The fact that some return an error message, which all appear to be fairly obvious, does not mean they do not work.

michellepace 07-17-2010 05:39 AM

Quote:

Originally Posted by grail (Post 4036162)
The fact that some return an error message, which all appear to be fairly obvious, does not mean they do not work.

ha ha, no not at all - this is not my world. Today is about the 4th time I've ever heard the world "linux" never mind using it. I'm very lucky to have found this newbie forum.

Quote:

Originally Posted by zirias (Post 4036138)
Those are not bash commands but seperate programs. You are just missing the /usr/bin/man and /usr/bin/clear binaries. How you install them depends on your distribution.

Finding which distribution I am running has been a topic of my previous post "What flavour of Unix am I using." My question is unanswered so if you have any light to shed (once again) it will be must appreciated.

You are correct as this is all I have in my bin. Perhaps do I have to somehow install 'wget' and then use that to install man, clear etc? ...I really would have thought these tools would have been part of a core tool package? Any hints as to how I can install stuff?

Code:

root@sdptfw:~ # ls -l /usr/bin/
total 8912
-rwxr-xr-x 1 root root  4716 2008-07-22 17:01 aread
-rwxr-xr-x 1 root root  4704 2008-07-22 17:01 atmdiag
lrwxrwxrwx 1 root root      4 2009-07-18 12:59 awk -> gawk
-rwxr-xr-x 1 root root  7016 2008-07-22 17:01 beep
-rwxr-xr-x 1 root root  7744 2008-07-22 17:01 br2684ctl
-rwxr-xr-x 1 root root  6860 2008-07-22 17:01 chattr
-rwxr-xr-x 1 root root  4644 2008-07-22 17:01 chvt
-rwxr-xr-x 1 root root  17044 2008-07-22 17:01 cmp
-rwxr-xr-x 1 root root  25564 2008-07-22 17:01 cut
-rwxr-xr-x 1 root root  5128 2008-07-22 17:01 deallocvt
-rwxr-xr-x 1 root root  61584 2008-07-22 17:01 diff
-rwxr-xr-x 1 root root  82744 2008-07-22 17:01 dig
-rwxr-xr-x 1 root root  14236 2008-07-22 17:01 dirname
-rwxr-xr-x 1 root root  53148 2008-07-22 17:01 dumpkeys
-rwxr-xr-x 1 root root  14164 2008-07-22 17:01 env
-rwxr-xr-x 1 root root  84976 2008-07-22 17:01 expr
-rwxr-xr-x 1 root root  61292 2008-07-22 17:01 ez-ipupdate
---x--x--- 1 root cron  14196 2008-07-22 17:01 fcronsighup
---x--s--x 1 cron cron  44612 2008-07-22 17:01 fcrontab
-rwxr-xr-x 1 root root  6164 2008-07-22 17:01 fdformat
-rwxr-xr-x 1 root root  4380 2008-07-22 17:01 fgconsole
-rwxr-xr-x 1 root root  56836 2008-07-22 17:01 find
-r-xr-xr-x 1 root root  6372 2008-07-22 17:01 free
-rwxr-xr-x 1 root root 250132 2008-07-22 17:01 gawk
-rwxr-xr-x 1 root root  5744 2008-07-22 17:01 getkeycodes
-rwxr-xr-x 1 root root  10100 2008-07-22 17:01 getopt
-rwxr-xr-x 1 root root 667060 2008-07-22 17:01 gpg
-rwxr-xr-x 1 root root  1931 2008-07-22 14:47 groups
-rwxr-xr-x 1 root root  68888 2008-07-22 17:01 host
-rwxr-xr-x 1 root root  13336 2008-07-22 17:01 hostid
-rwxr-xr-x 1 root root  29452 2008-07-22 17:01 htpasswd
-rwxr-xr-x 1 root root  17016 2008-07-22 17:01 id
-rwxr-xr-x 1 root root  24728 2008-07-22 17:01 join
-rwxr-xr-x 1 root root  5744 2008-07-22 17:01 kbd_mode
-rwxr-xr-x 1 root root  12004 2008-07-22 17:01 last
lrwxrwxrwx 1 root root      4 2009-07-18 12:59 lastb -> last
-rwxr-xr-x 1 root root  8228 2008-07-22 17:01 logger
-rwxr-xr-x 1 root root  5812 2008-07-22 17:01 lsattr
-rwxr-xr-x 1 root root  31184 2008-07-22 17:01 md5sum
-rwxr-xr-x 1 root root  4472 2008-07-22 17:01 mesg
-r-xr-xr-x 1 root root  5748 2008-07-22 17:01 mktemp
-rwxr-xr-x 1 root root  71816 2008-07-22 17:01 nano
-rwxr-xr-x 1 root root  16108 2008-07-22 17:01 nice
-rwxr-xr-x 1 root root  16020 2008-07-22 17:01 nohup
-rwxr-xr-x 1 root root  18372 2008-07-22 17:01 noip
-rwxr-xr-x 1 root root  43300 2008-07-22 17:01 nsupdate
-rwxr-xr-x 1 root root 414500 2008-07-22 17:01 ntpd
-rwxr-xr-x 1 root root  55000 2008-07-22 17:01 ntpdate
-rwxr-xr-x 1 root root  4788 2008-07-22 17:01 oam_ping
-rwxr-xr-x 1 root root 342408 2008-07-22 17:01 openssl
-rwxr-xr-x 1 root root  14148 2008-07-22 17:01 passwd
-rwxr-xr-x 1 root root  16532 2008-07-22 17:01 paste
-rwxr-xr-x 1 root root  85020 2008-07-22 17:01 patch
-rwxr-xr-x 3 root root 962768 2008-07-23 22:58 perl
-rwxr-xr-x 3 root root 962768 2008-07-23 22:58 perl5.8.5
-rwxr-xr-x 1 root root  23212 2008-07-22 17:01 pg
lrwxrwxrwx 1 root root    13 2009-07-18 12:59 pico -> /usr/bin/nano
-rwxr-xr-x 1 root root  30992 2008-07-22 17:01 ping
-rwxr-xr-x 1 root root 919500 2008-07-22 17:01 python
-rwxr-xr-x 1 root root  4544 2008-07-22 17:01 rename
-rwxr-xr-x 1 root root  4644 2008-07-22 17:01 renice
-rwxr-xr-x 1 root root  45588 2008-07-22 17:01 scp
-rwxr-xr-x 1 root root  18348 2008-07-22 17:01 seq
-rwxr-xr-x 1 root root  30728 2008-07-22 17:01 setfont
-rwxr-xr-x 1 root root  5156 2008-07-22 17:01 setkeycodes
-rwxr-xr-x 1 root root  6824 2008-07-22 17:01 setleds
-rwxr-xr-x 1 root root  4380 2008-07-22 17:01 setlogcons
-rwxr-xr-x 1 root root  4528 2008-07-22 17:01 setmetamode
-rwxr-xr-x 1 root root  9964 2008-07-22 17:01 showconsolefont
-rwxr-xr-x 1 root root  7768 2008-07-22 17:01 showkey
-rwxr-xr-x 1 root root  40108 2008-07-22 17:01 sort
-rws--x--x 1 root root 963088 2008-07-23 22:58 sperl5.8.5
-rwxr-xr-x 1 root root  23272 2008-07-22 17:01 split
-rwxr-xr-x 1 root root  39444 2008-07-22 15:38 squid-graph
-rwxr-xr-x 1 root root 115560 2008-07-22 17:01 ssh-keygen
-rwxr-xr-x 1 root root  33188 2008-07-22 17:01 stat
-rwxr-xr-x 3 root root 962768 2008-07-23 22:58 suidperl
-rwxr-xr-x 1 root root  36172 2008-07-22 17:01 tail
-rwxr-xr-x 1 root root  14840 2008-07-22 17:01 tee
-r-xr-xr-x 1 root root  52396 2008-07-22 17:01 top
-rwxr-xr-x 1 root root  10068 2008-07-22 17:01 tput
-rwxr-xr-x 1 root root  30740 2008-07-22 17:01 tr
-rwxr-xr-x 1 root root  1423 2008-07-22 14:58 unicode_start
-rwxr-xr-x 1 root root    57 2008-07-22 14:58 unicode_stop
-rwxr-xr-x 1 root root  11208 2008-07-22 17:01 unicorn_status
-rwxr-xr-x 1 root root  22552 2008-07-22 17:01 uniq
-r-xr-xr-x 1 root root  3312 2008-07-22 17:01 uptime
-rwxr-xr-x 1 root root  7676 2008-07-22 17:01 utmpdump
lrwxrwxrwx 1 root root      3 2009-07-18 12:59 vi -> vim
-rwxr-xr-x 1 root root 468728 2008-07-22 17:01 vim
-r-xr-xr-x 1 root root  16228 2008-07-22 17:01 vmstat
-r-xr-xr-x 1 root root  9480 2008-07-22 17:01 w
-rwxr-xr-x 1 root root  8120 2008-07-22 17:01 wall
-rwxr-xr-x 1 root root  19380 2008-07-22 17:01 wc
-rwxr-xr-x 1 root root  23176 2008-07-22 17:01 who
-rwxr-xr-x 1 root root  14200 2008-07-22 17:01 whoami
-rwxr-xr-x 1 root root  13384 2008-07-22 17:01 yes
root@sdptfw:~ #


Aquarius_Girl 07-17-2010 06:13 AM

Quote:

Originally Posted by michellepace (Post 4036103)
Hi there, below are the details of my system. I have bash as my current shell, some really common commands aren't working. Please see below.

The FAQ shown in the following post of mine explains why the basic things are not working on your system:
http://www.linuxquestions.org/questi...8/#post4036207

bigrigdriver 07-17-2010 06:28 AM

To find out which GNU/Linux distribution you are using, look at file /etc/issue (or it may be named /etc/issue.net or something similar).

michellepace 07-17-2010 07:44 AM

thanks, I found out I'm running an IPCOP distribution.

Code:

root@sdptfw:~ # cat /etc/issue
IPCop v1.4.21 - The Bad Packets Stop Here
root@sdptfw:~ #

I'll start looking in the help files and suggested links from anishakaul to find out how to install man, clear and all the rest.

For anyone else with the same question, when I find out I will post the steps in this thread.

zirias 07-17-2010 07:47 AM

Well ... if this box should really be a firewall, it's probably not the best idea to install all that stuff, why would you want it on a firewall?

And -- if you DON'T use this box as a firewall, I'd rather install a "normal" distribution.

michaelk 07-17-2010 07:53 AM

Just in case you did not read the links provided in your other thread, ipcop is a linux distribution designed for a specific purpose i.e. an appliance firewall computer. It is not a desktop distribution and since your new to the linux world it would be helpful to know some background information. Did you installed ipcop and what you are trying to accomplish.

michellepace 07-17-2010 08:14 AM

Quote:

Originally Posted by michaelk (Post 4036270)
Just in case you did not read the links provided in your other thread, ipcop is a linux distribution designed for a specific purpose i.e. an appliance firewall computer. It is not a desktop distribution and since your new to the linux world it would be helpful to know some background information. Did you installed ipcop and what you are trying to accomplish.

oh... well... now that I get asked bluntly. Well I think I started to want to water the flowers and now somehow I've found myself at the waterworks asking how the pipes have been layed and why.

Yes, this is a firwall. Yes that makes sense - I don't want to install all that stuff if it breaches any kind of security.

Where it started is that I wanted to install an additional IPCOP addon and I didn't quite know where to do that. I posted on the IPCOP forum here but didn't get an answer.

I thought I would find out what distribution I was running so that I could google the filesystem and find out about it's structure. So then I came across uname and wanted to know the availble options which lead me to discover that I don't have man (or wget or clear) installed.

What am I trying to accomplish? It's rather embarrasing, I've lost myself down the garden path. Thanks. I'm walking back over to the flowers now. I really should be setting up an additional person on IPCOP's logging. That's it. :redface:

michellepace 07-17-2010 08:39 AM

The general lesson here being to read before you post... regardless, here's the information I've been looking for obtained from IPCOP'S FAQ: Customising IPCop

Can I customise my IPCop box?

Because your IPCop box is based on Linux, many of the features used in Linux can be made available by your firewall. IPCop is made to be easy to use, and the web interface reflects that. There are many features that are not made accesible by the web interface in order to keep it simple.

The important thing to remember is that the IPCop box is primarily a firewall and a router. All the other features are "nice to have". Anything you do to your IPCop box could reduce it's effectiveness, and the programmers won't be looking out for security holes in programs you have added, so they won't be making patches either.

If you want something more general purpose than a dedicated firewall you can have a look at the Gateway/Servers at this comparision list.


Where do I start?

First of all, IPCop is missing many of the programs usually found in a Linux distribution. This is deliberate, as the lower number of applications means the system is simpler, and easier to keep secure

Because of this, our way in and out of the IP-Cop box is via a program called SSH. SSH is a secure command line interface which allows remote access. Normally, SSH uses port 22, but in order to allow port 22 to be forwarded elsewhere, port 222 is used on the IP-Cop box.

Most Linux distributions now include the SSH suite of programs, and there is a freeware Windows client called PuTTY. SSH includes a file transfer client called SCP, and there is also a freeware Windows version called WinSCP. Between these two programs, you should have all the tools you need to customise IP-Cop.


How can I add a new program to IPCop?

Using SCP, you can download new files into the IPCop box. This way you can add additional programs that may help you faultfind your network, or add additional functionality.

For example, IP-Cop does not have "traceroute" (It has tracepath, which has similar functionality). Using SCP (or WinSCP), simply move the file from another Linux box into the appropriate folder (/usr/sbin, in this case), check the file permisions, and now you have an new tool on your IPCop box.

Shadow_7 07-17-2010 09:19 AM

It's a flavor of linux so yes. And no. Since it's firewall orientated, it probably lacks basic tools. Like a compiler and development environment. That way even if it is breached, the breacher lacks the ability to do anything useful. At least with the methods that they assumed that they would have available.

As far as the other thing. If those commands are available, but you just can't use them. It might be a security thing. But I've hosed libc6 at least once in my life which disabled pretty much every bash command (extended application) known to man. Including ls. Not saying that that is your issue, but it could be.


All times are GMT -5. The time now is 08:00 PM.