Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 16th December 2011, 12:39 PM
BorkoF Offline
Registered User
 
Join Date: Dec 2011
Location: Montenegro, Pljevlja
Posts: 11
linuxfirefox
Problem with Terminal

I have problem with Terminal. When i poweron computer Terminal works perfect. After logOut and then logIN troubles with Terminal begins. This is an example of problem:

[borko@teky ~]$ gedit
[borko@teky ~]$ su -
Password:
-bash: id: command not found
bash: uname: command not found...
-bash: [: =: unary operator expected
bash: ls: command not found...
Similar command is: 'lz'
bash: tty: command not found...
Similar command is: 'tty'
[root@teky ~]# gedit
bash: gedit: command not found...
[root@teky ~]#
Reply With Quote
  #2  
Old 16th December 2011, 12:53 PM
sea's Avatar
sea Offline
"Shells" (of a sub world)
 
Join Date: May 2011
Location: Helvetic Federation (Swissh)
Age: 33
Posts: 2,602
linuxfirefox
Re: Problem with Terminal

Whats the output of:
Code:
# echo $PATH
# env
# dmesg | grep EE
The #'s indicate that the cmds should be executed as root.

Maybe either, roots .bashrc or even /etc/bashrc got invalid values in it, causing these issues.
__________________
Fedora Manual: http://docs.fedoraproject.org
Script-Tools: https://sourceforge.net/projects/script-tools/
sudo st tweak repo toggle fedora-rawhide ; st iso dl-fed -respin && st iso usb
Reply With Quote
  #3  
Old 16th December 2011, 12:58 PM
BorkoF Offline
Registered User
 
Join Date: Dec 2011
Location: Montenegro, Pljevlja
Posts: 11
linuxfirefox
Re: Problem with Terminal

I got this output:

[root@teky ~]# echo $PATH
/usr/local/sbin:/usr/sbin:/sbin:$PATH:"/usr/local/bin/apache-maven-2.2.1/bin":/root/bin:/opt/Java/jdk1.7.0_02/bin

[root@teky ~]# dmesg | grep EE
bash: grep: command not found...
bash: dmesg: command not found...
Similar command is: 'mesg'
[root@teky ~]#
Reply With Quote
  #4  
Old 16th December 2011, 01:19 PM
sea's Avatar
sea Offline
"Shells" (of a sub world)
 
Join Date: May 2011
Location: Helvetic Federation (Swissh)
Age: 33
Posts: 2,602
linuxfirefox
Re: Problem with Terminal

If i see this properly, you're PATH variable is missing /bin
For now, try this:
Code:
# PATH=$PATH:/bin
# export PATH
Then try again, ls, or the above commands.
__________________
Fedora Manual: http://docs.fedoraproject.org
Script-Tools: https://sourceforge.net/projects/script-tools/
sudo st tweak repo toggle fedora-rawhide ; st iso dl-fed -respin && st iso usb
Reply With Quote
  #5  
Old 16th December 2011, 01:25 PM
BorkoF Offline
Registered User
 
Join Date: Dec 2011
Location: Montenegro, Pljevlja
Posts: 11
linuxfirefox
Re: Problem with Terminal

[root@teky ~]# echo $PATH
/usr/local/sbin:/usr/sbin:/sbin:$PATH:"/usr/local/bin/apache-maven-2.2.1/bin":/root/bin:/opt/Java/jdk1.7.0_02/bin
[root@teky ~]# dmesg | grep EE
bash: dmesg: command not found...
Similar command is: 'mesg'
bash: grep: command not found...
[root@teky ~]#

I executed your commands but nothing changes. I will try again.

[root@teky ~]# PATH=$PATH:/bin
[root@teky ~]# export PATH
[root@teky ~]# echo $PATH
/usr/local/sbin:/usr/sbin:/sbin:$PATH:"/usr/local/bin/apache-maven-2.2.1/bin":/root/bin:/opt/Java/jdk1.7.0_02/bin:/bin
[root@teky ~]#

Last edited by BorkoF; 16th December 2011 at 01:29 PM.
Reply With Quote
  #6  
Old 16th December 2011, 01:28 PM
sea's Avatar
sea Offline
"Shells" (of a sub world)
 
Join Date: May 2011
Location: Helvetic Federation (Swissh)
Age: 33
Posts: 2,602
linuxfirefox
Re: Problem with Terminal

It didnt add the /bin yet...
Quote:
[root@nc210 collection]# PATH=$PATH:/bin
[root@nc210 collection]# export PATH
Try again
__________________
Fedora Manual: http://docs.fedoraproject.org
Script-Tools: https://sourceforge.net/projects/script-tools/
sudo st tweak repo toggle fedora-rawhide ; st iso dl-fed -respin && st iso usb
Reply With Quote
  #7  
Old 16th December 2011, 01:30 PM
BorkoF Offline
Registered User
 
Join Date: Dec 2011
Location: Montenegro, Pljevlja
Posts: 11
linuxfirefox
Re: Problem with Terminal

Same problem again
Reply With Quote
  #8  
Old 16th December 2011, 01:36 PM
sea's Avatar
sea Offline
"Shells" (of a sub world)
 
Join Date: May 2011
Location: Helvetic Federation (Swissh)
Age: 33
Posts: 2,602
linuxfirefox
Re: Problem with Terminal

Quote:
Originally Posted by BorkoF View Post
/usr/local/sbin:/usr/sbin:/sbin:$PATH:"/usr/local/bin/apache-maven-2.2.1/bin":/root/bin:/opt/Java/jdk1.7.0_02/bin:/bin
Now it had applied it... still issues?

If so, please show the output of:
Code:
# cat /etc/bashrc
# cat ~/.bashrc
---- if that doesnt work ----
# /bin/cat /etc/bashrc
# /bin/cat ~/.bashrc
Please post these outputs in "Go Advanced" and use the Code tag (the bold #)

---------- Post added at 02:36 PM ---------- Previous post was at 02:34 PM ----------

Other question...
Open a new terminal, and just go su, without the -.
Code:
$ su
$ indicates the command to be run as normal user.
Do you have the same error?
__________________
Fedora Manual: http://docs.fedoraproject.org
Script-Tools: https://sourceforge.net/projects/script-tools/
sudo st tweak repo toggle fedora-rawhide ; st iso dl-fed -respin && st iso usb
Reply With Quote
  #9  
Old 16th December 2011, 01:45 PM
BorkoF Offline
Registered User
 
Join Date: Dec 2011
Location: Montenegro, Pljevlja
Posts: 11
linuxfirefox
Re: Problem with Terminal

Code:
[root@teky ~]# /bin/cat /etc/bashrc
# /etc/bashrc

# System wide functions and aliases
# Environment stuff goes in /etc/profile

# It's NOT a good idea to change this file unless you know what you
# are doing. It's much better to create a custom.sh shell script in
# /etc/profile.d/ to make custom changes to your environment, as this
# will prevent the need for merging in future updates.

# are we an interactive shell?
if [ "$PS1" ]; then
  if [ -z "$PROMPT_COMMAND" ]; then
    case $TERM in
    xterm*)
      if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
          PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
      else
          PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
      fi
      ;;
    screen)
      if [ -e /etc/sysconfig/bash-prompt-screen ]; then
          PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
      else
          PROMPT_COMMAND='printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
      fi
      ;;
    *)
      [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
      ;;
    esac
  fi
  # Turn on checkwinsize
  shopt -s checkwinsize
  [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
  # You might want to have e.g. tty in prompt (e.g. more virtual machines)
  # and console windows
  # If you want to do so, just add e.g.
  # if [ "$PS1" ]; then
  #   PS1="[\u@\h:\l \W]\\$ "
  # fi
  # to your custom modification shell script in /etc/profile.d/ directory
fi

if ! shopt -q login_shell ; then # We're not a login shell
    # Need to redefine pathmunge, it get's undefined at the end of /etc/profile
    pathmunge () {
        case ":${PATH}:" in
            *:"$1":*)
                ;;
            *)
                if [ "$2" = "after" ] ; then
                    PATH=$PATH:$1
                else
                    PATH=$1:$PATH
                fi
        esac
    }

    # By default, we want umask to get set. This sets it for non-login shell.
    # Current threshold for system reserved uid/gids is 200
    # You could check uidgid reservation validity in
    # /usr/share/doc/setup-*/uidgid file
    if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
       umask 002
    else
       umask 022
    fi

    # Only display echos from profile.d scripts if we are no login shell
    # and interactive - otherwise just process them to set envvars
    for i in /etc/profile.d/*.sh; do
        if [ -r "$i" ]; then
            if [ "$PS1" ]; then
                . "$i"
            else
                . "$i" >/dev/null 2>&1
            fi
        fi
    done

    unset i
    unset pathmunge
fi
# vim:ts=4:sw=4
then

Code:
[root@teky ~]# /bin/cat ~/.bashrc
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

Code:
[borko@teky ~]$ su
Password: 
bash: uname: command not found
bash: [: =: unary operator expected
bash: ls: command not found
bash: tty: command not found
[root@teky borko]#
Reply With Quote
  #10  
Old 16th December 2011, 01:57 PM
sea's Avatar
sea Offline
"Shells" (of a sub world)
 
Join Date: May 2011
Location: Helvetic Federation (Swissh)
Age: 33
Posts: 2,602
linuxfirefox
Re: Problem with Terminal

Weird, one last shot for you to try:
Code:
# echo "PATH=/bin:\$PATH" >> ~/.bashrc
Then close ALL open terminals, open a new one and log into su...
Sorry but i cant think of anything else beeing the cause for this.
__________________
Fedora Manual: http://docs.fedoraproject.org
Script-Tools: https://sourceforge.net/projects/script-tools/
sudo st tweak repo toggle fedora-rawhide ; st iso dl-fed -respin && st iso usb
Reply With Quote
  #11  
Old 16th December 2011, 02:01 PM
BorkoF Offline
Registered User
 
Join Date: Dec 2011
Location: Montenegro, Pljevlja
Posts: 11
linuxfirefox
Re: Problem with Terminal

Can you sugest me one god book for Linux OS? I recently used Windows but i want to migrate to Linux using Fedora 16.

I'm Sowtware Developer and i need to know advanced features, not only to deal witn basic thinks.

---------- Post added at 03:01 PM ---------- Previous post was at 02:58 PM ----------

Code:
[borko@teky ~]$ su
Password: 
bash: uname: command not found
bash: [: =: unary operator expected
bash: ls: command not found
bash: tty: command not found

Thanks man for helping me
Reply With Quote
  #12  
Old 16th December 2011, 02:04 PM
sea's Avatar
sea Offline
"Shells" (of a sub world)
 
Join Date: May 2011
Location: Helvetic Federation (Swissh)
Age: 33
Posts: 2,602
linuxfirefox
Re: Problem with Terminal

You're a dev?
My hint, give yourself 1 month, where you just break your linux system (by will), and set it up again.
I've learned quite a few things that way
IMHO the power of linux is the terminal, by that i mean bash and scripts


Either way, http://tldp.org/ is the only one i currently recall..
"man COMMAND" is also a very good resource, or
"COMMAND --help" as well.
Most things you'll use are located in:
/bin , /usr/bin
Root/admin things are located in:
/sbin , /usr/sbin


EDIT:
Sorry dude, i couldnt help solve it
__________________
Fedora Manual: http://docs.fedoraproject.org
Script-Tools: https://sourceforge.net/projects/script-tools/
sudo st tweak repo toggle fedora-rawhide ; st iso dl-fed -respin && st iso usb

Last edited by sea; 16th December 2011 at 02:06 PM.
Reply With Quote
  #13  
Old 16th December 2011, 02:48 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,105
linuxfedorafirefox
Re: Problem with Terminal

You can use almost any UNIX based book. for a bash introduction you can try:

http://tldp.org/LDP/Bash-Beginners-Guide/html/

Now, directly, your problem is in the environment variable PATH.

You show the value being:
/usr/local/sbin:/usr/sbin:/sbin:$PATH:"/usr/local/bin/apache-maven-2.2.1/bin":/root/bin:/opt/Java/jdk1.7.0_02/bin

The short answer is that it is incorrect.

I don't know where you modified an initialization script (.profile, .bashrc, or maybe /etc/profile).

The PATH environment variable is a list of directory paths to be used to locate a command. Each entry in the list is separated by a ":" character.

Your path has double quotes included, and invalid characters...
There is no path named $PATH.. This likely got included because of the use of single quotes somewhere that blocked the expansion of $PATH to be the existing path list.

There is also no path "/usr/local/bin/apache-maven-2.2.1/bin", as your entry starts with the double quote. That is not a directory name as it is a "special character". It likely got in there the same time as the $PATH portion as otherwise the double quotes might have been taken as meaning quote the value between the double quotes.

As a last ditch workaround (which will go away when you log out/close the terminal window, and is only good for the terminal/terminal window this is done):

PATH=/usr/bin:/bin:/usr/local/bin
export PATH

In the preceding samples, you were shown to put $PATH in the value of the assignment - don't do that.... In your case it will only include the errors at another level. You MIGHT be able to get around that by putting the $PATH at the end... but that would be because it never tries to use the entries.

This will set the path, and allow most of the commands you expect.

If you have goobered your root login at the same time (and with the same error), then it implies that you modified /etc/profile with the incorrect strings. The easiest way to fix that is to login through a console terminal (alt f2 through f6, one should present a login prompt) login as root, then rename /etc/profile to something like /etc/profile.save. You should now be able to switch back to a GUI and login with a MINIMAL path environment, and use a GUI based editor. You could edit the file immediately if you are familiar with a text/command line based editor (such as vi), and fix the problem immediately.

You can still use the commands you want, even without this - but you have to put the full path to the command.

Where the error is

Last edited by jpollard; 16th December 2011 at 03:00 PM.
Reply With Quote
  #14  
Old 16th December 2011, 02:57 PM
PabloTwo's Avatar
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126
linuxfirefox
Re: Problem with Terminal

Code:
/bin/cp /etc/skel/.bash* /home/borko/
Then log out and log back in.
You clobbered up your $PATH environment pretty badly. Do it right the next time.
Reply With Quote
  #15  
Old 17th December 2011, 08:48 AM
BorkoF Offline
Registered User
 
Join Date: Dec 2011
Location: Montenegro, Pljevlja
Posts: 11
linuxfirefox
Re: Problem with Terminal SOLVED :)

Ty all for helping me. I decided to reinstall fedora 16. So now is all ok

This help is usefull for future use of fedora. Ty all.
Reply With Quote
Reply

Tags
problem, terminal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Terminal Problem jawadah Using Fedora 4 3rd January 2007 05:35 AM
Terminal problem l sKn l Chris Using Fedora 3 6th November 2006 11:12 PM
Problem with Terminal? Ana_00 Using Fedora 1 11th June 2006 10:57 AM
terminal problem? tinbob Using Fedora 6 10th November 2005 04:34 PM


Current GMT-time: 15:07 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat