The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Bash/Unix Command Errors wcmmlynn UNIX for Advanced & Expert Users 0 11-13-2007 03:47 AM
errors with bm.zip csaunders UNIX Benchmarks 0 04-04-2006 02:41 PM
Adapter Errors and Link Errors mcastill66 AIX 2 08-02-2005 06:51 PM
Adapter Errors and Link Errors mcastill66 UNIX for Advanced & Expert Users 0 08-02-2005 06:11 PM
awk errors billy5 Shell Programming and Scripting 4 06-22-2005 06:30 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-13-2007
wcmmlynn wcmmlynn is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 9
Major OS errors/Bash errors help!!!!

Hi all, dummy here.... I have major errors on entering the shell. On login I get:

-bash: dircolors: command not found
-bash: tr: command not found
-bash: fgrep: command not found
-bash: grep: command not found
-bash: grep: command not found
-bash: id: command not found
-bash: [: =: unary operator expected
-bash: whoami: command not found
-bash: grep: command not found
-bash: mesg: command not found
-bash: dircolors: command not found
-bash: who: command not found
-bash: cut: command not found
-bash: cut: command not found
-bash: hostname: command not found
-bash: mail: command not found
-bash: date: command not found
-bash: who: command not found
-bash: hostname: command not found
-bash: date: command not found
-bash: who: command not found
-bash: hostname: command not found
-bash: date: command not found
-bash: who: command not found
-bash: cut: command not found
-bash: cut: command not found
-bash: who: command not found
-bash: mail: command not found
-bash: hostname: command not found
-bash: date: command not found
-bash: who: command not found


Using Centos 4.5 on a dual Xeon server with WHM/CP and a few rpm's.

This happened after installing Flash Media Server which has been removed.

Many crucial unix commands are not functioning. Can't even use ping or mkdir, etc.

Any thoughts? Can I avoid an OS restore?
  #2 (permalink)  
Old 11-13-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by wcmmlynn View Post
Can I avoid an OS restore?
Hm, depends..

You will have to work purely with bash internal commands....

Code:
#see where we are
pwd
# see where commands are supposed to be
echo $PATH
# go to the root 
cd /
# see what root directories there are
echo *
# see if anything is in bin
echo /bin/*
# and usr/bin
echo /usr/bin/*
  #3 (permalink)  
Old 11-13-2007
wcmmlynn wcmmlynn is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 9
You will have to work purely with bash internal commands....

Ran the commands, all greek to me...

root@host [/bin]#
root@host [/bin]# pwd
/bin
root@host [/bin]# echo #path

root@host [/bin]# cd /
root@host [/]# echo /bin/*
/bin/arch /bin/ash /bin/ash.static /bin/awk /bin/basename /bin/bash /bin/bsh /bin/cat /bin/chgrp /bin/chmod /bin/chown /bin/cp /bin/cpio /bin/csh /bin/cut /bin/date /bin/dd /bin/df /bin/dmesg /bin/dnsdomainname /bin/doexec /bin/domainname /bin/dumpkeys /bin/echo /bin/ed /bin/egrep /bin/env /bin/ex /bin/false /bin/fgrep /bin/gawk /bin/gettext /bin/grep /bin/gtar /bin/gunzip /bin/gzip /bin/hostname /bin/igawk /bin/ipcalc /bin/kbd_mode /bin/kill /bin/ksh /bin/link /bin/ln /bin/loadkeys /bin/login /bin/ls /bin/mail /bin/mailx /bin/mkdir /bin/mknod /bin/mktemp /bin/more /bin/mount /bin/mt /bin/mv /bin/netstat /bin/nice /bin/nisdomainname /bin/passwd /bin/pgawk /bin/ping /bin/ping6 /bin/ps /bin/pwd /bin/red /bin/rm /bin/rmdir /bin/rpm /bin/rvi /bin/rview /bin/sed /bin/setfont /bin/setserial /bin/sh /bin/sleep /bin/sort /bin/stty /bin/su /bin/sum /bin/sync /bin/tar /bin/tcsh /bin/touch /bin/tracepath /bin/tracepath6 /bin/traceroute /bin/traceroute6 /bin/true /bin/umount /bin/uname /bin/unicode_start /bin/unicode_stop /bin/unlink /bin/usleep /bin/vi /bin/view /bin/ypdomainname /bin/zcat
root@host [/]# echo /usr/bin*
/usr/bin
root@host [/]#
  #4 (permalink)  
Old 11-13-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
nearly, it was "echo $PATH" , not "echo #PATH"

and "echo /usr/bin/*" not "/echo /usr/bin*"

so it looks like all the commands exist but maybe your PATH is trashed.

Try

if "echo $PATH" does not print anything then try...

Code:
PATH=/bin:/usr/bin
export PATH
  #5 (permalink)  
Old 11-13-2007
wcmmlynn wcmmlynn is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 9
Sorry... and thanks for your help!

root@host [/]# echo $PATH
/usr/local/jdk/bin:/usr/local/jdk/bin:/usr/kerberos/bin:/usr/lib/courier-imap/sbin:/usr/lib/courier-imap/bin:/usr/local/ant/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin:/usr/local/bin:/usr/X11R6/bin

Also noted ls in the /bin nets a list of commands however several are redlined.
root@host [/bin]# ls
./ csh@ false* ln* nisdomainname@ setserial* true*
../ cut* fgrep@ loadkeys* passwd@ sh@ umount*
arch* date* gawk* login* pgawk* sleep* uname*
ash* dd* gettext* ls* ping* sort* unicode_start*
ash.static* df* grep* mail* ping6* stty* unicode_stop*
awk@ dmesg* gtar@ mailx@ ps* su* unlink*
basename* dnsdomainname@ gunzip* mkdir* pwd* sum@ usleep*
bash* doexec* gzip* mknod* red@ sync* vi*
bsh@ domainname@ hostname* mktemp* rm* tar* view@
cat* dumpkeys* igawk* more* rmdir* tcsh* ypdomainname@
chgrp* echo* ipcalc* mount* rpm* touch* zcat*
chmod* ed* kbd_mode* mt* rvi@ tracepath*
chown* egrep@ kill* mv* rview@ tracepath6*
cp* env* ksh* netstat* sed* traceroute
cpio* ex@ link* nice* setfont* traceroute6*


Your recommendation is a great temp fix (PATH=/bin:/usr/bin
export PATH) but when I logout/login it breaks again. Is there a permanent way to fix this path?

Last edited by wcmmlynn; 11-13-2007 at 03:59 AM.. Reason: More data
  #6 (permalink)  
Old 11-13-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by wcmmlynn View Post
root@host [/]# echo $PATH
/usr/local/jdk/bin:/usr/local/jdk/bin:/usr/kerberos/bin:/usr/lib/courier-imap/sbin:/usr/lib/courier-imap/bin:/usr/local/ant/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin:/usr/local/bin:/usr/X11R6/bin
So your PATH has everything except "/bin" and "/usr/bin" !!!

Are you running everything as root, or do you have a standard user account for normal work?

.... and root should also have "/sbin" and "/usr/sbin" in the path.

Looks like you have alot more than you need for normal root operation, everything but the kitchen sink (and the directories you actually need).
  #7 (permalink)  
Old 11-13-2007
wcmmlynn wcmmlynn is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 9
For shell work it is all Root.

After running your code path changes:

root@host [~]# echo $PATH
/bin:/usr/bin


So wondering how to get /bin and /usr/bin back in the path?
Sponsored Links
Closed Thread

Bookmarks

Tags
cpio, unix commands

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 03:11 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0