- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Internal commands
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2003 12:34 AM
тАО07-29-2003 12:34 AM
Internal commands
Hi all,
Is there anything called internal commands in HP Unix? I have renamed /usr/bin/ls to ls.old, still ls is listiing the directory. Where from this ls is getting executed?
TIA
Shahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2003 12:39 AM
тАО07-29-2003 12:39 AM
Re: Internal commands
If you wish to check where you are sourcing a command, you can always do:
whence
for example
root @uksd3 #whence date
/usr/bin/date
I do know cd is one of hte built-ins, and here is an example
root @uksd3 #whence cd
cd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2003 12:46 AM
тАО07-29-2003 12:46 AM
Re: Internal commands
there is lots of Internal Commands in Unix whihc is part of shell basically.
like cd
ls is external command you can find out which ls is getting excuted using which command
#which ls
you will get answer.....
sunil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2003 12:49 AM
тАО07-29-2003 12:49 AM
Re: Internal commands
Check as follows.
whence ls
type ls(type is a internal command in ksh)
which ls
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2003 01:39 AM
тАО07-29-2003 01:39 AM
Re: Internal commands
Hi,
which ls is giving /usr/bin/ls output. Even if I rename this, ls command works. Don't know where from this?
Thanks and regards
Shahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2003 01:41 AM
тАО07-29-2003 01:41 AM
Re: Internal commands
i know to be a bit late...
From man csh you get a full list of the built-in commands.
From man ksh you don't get the list, they are talked about here and there.
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2003 02:08 AM
тАО07-29-2003 02:08 AM
Re: Internal commands
Most likely you're picking up /sbin/ls.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2003 02:28 AM
тАО07-29-2003 02:28 AM
Re: Internal commands
There is also no man page for whence, so I suspect/believe that whence is one of htose built-in commands that I had forgotten ;-]
Interestingly, if you start a ksh, and then do a whence ls, this DOES show /usr/bin/ls
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2003 02:57 AM
тАО07-29-2003 02:57 AM
Re: Internal commands
it does take from /sbin/ls.
internal commands are varies according to the shells.
here are some.it may not be same in all shells and in all unix flavours.
: (colon) exec shift
. (dot) exit times
break export trap
continue readonly wait
eval return
how are u ?
radhakrishnan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2003 03:25 AM
тАО07-29-2003 03:25 AM
Re: Internal commands
if output of "which ls" /usr/bin/ls
it means in /usr/bin directory ls is there
just check it once again.
and just post the output of
whereis ls
command
Sunil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2003 04:03 AM
тАО07-29-2003 04:03 AM
Re: Internal commands
type ls
type cd
type pwd
type fc
type for
For instance, which and whereis have no idea what 'for' might be, but 'type' (whence -v) definitely knows. Many shell built-in commands are found in /usr/bin but are simple shell scripts with the shell built-in:
cat /usr/bin/ulimit
type ulimit
There are also situations where the external command is better than the shell built-in:
cd /usr/spool/lp
pwd
/usr/bin/pwd
You'll see that the built-in pwd remembers how you got to the /usr/spool/lp (the legacy directory for the spooler, which is a symlink) but /usr/bin/pwd shows the 'real' directory (/var/spool/lp).
The 'whence' (and 'type') commands are part of POSIX shells such as /usr/bin/sh and /usr/bin/ksh (and bash if you added that shell).
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2003 04:09 AM
тАО07-29-2003 04:09 AM
Re: Internal commands
/bin
/sbin
/usr/bin
Regards,
Jerome
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2003 07:50 AM
тАО07-30-2003 07:50 AM
Re: Internal commands
wh command. which is also linked as whall in my user local bin.
#!/bin/sh
#ident "@(#) Rory Hammond - - /usr/local/bin/wh"
# 07-11-93 replaced C program with this shell
#
# wh
#
# Examine the path for a command & tell which dir has it. Stop with
# the 1st dir that has it.
#
# whall link whall to wh and it will find all occurance in the paths
#
if [ $# -eq 0 ]
then
echo "usage:\t$0 prognam ...." | sed -e 's/\/\//\//g'
exit 1
fi
dirs=`echo $PATH |
sed -e 's/^:/.:/' -e 's/:$/:./' -e 's/::/:.:/' -e 's/:/ /g'`
notfound=
for ffile in $*
do
found=0
for dir in $dirs
do
if [ -x ${dir}/${ffile} -a ! -d "${dir}/$1" ]
then
echo "${dir}/${ffile}"| sed -e 's/\/\//\//g'
found=1
if [ $0 = "whall" ]
then
break
fi
fi
done
if [ ${found} -eq 0 ]
then
notfound="${notfound} $1"
fi
shift
done
#report the not found
for arg in $notfound
do
echo "${arg} not found"
done
exit 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2003 08:00 AM
тАО07-30-2003 08:00 AM
Re: Internal commands
You might have picked up /sbin/ls.
# whereis ls
shows the paths of ls.
Removing sbin from the path will stop ls from working in your case.
Hai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2003 09:55 AM
тАО07-30-2003 09:55 AM
Re: Internal commands
Whereis shows all occurance. The shell script shows which one you are executing
The man pages do describe commands. One of the problems that you encounter alias will fool you path
alias ls="/sbin/ls -l"
man sh-bourne lists the "special commands"
rory
#!/bin/sh
#ident "@(#) Rory Hammond -menlo - /usr/local/bin/wh"
# 07-11-93 replaced C program with this shell
#
# wh
#
# Examine the path for a command & tell which dir has it. Stop with
# the 1st dir that has it.
#
#
if [ $# -eq 0 ]
then
echo "usage:\t$0 prognam ...." | sed -e 's/\/\//\//g'
exit 1
fi
dirs=`echo $PATH |
sed -e 's/^:/.:/' -e 's/:$/:./' -e 's/::/:.:/' -e 's/:/ /g'`
notfound=
for ffile in $*
do
found=0
for dir in $dirs
do
if [ -x ${dir}/${ffile} -a ! -d "${dir}/$1" ]
then
echo "${dir}/${ffile}"| sed -e 's/\/\//\//g'
found=1
break
fi
done
if [ ${found} -eq 0 ]
then
notfound="${notfound} $1"
fi
shift
done
#report the not found
for arg in $notfound
do
echo "${arg} not found"
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2003 10:27 AM
тАО07-30-2003 10:27 AM
Re: Internal commands
type ls
this will show you where the ls command was executed from.
if you are concerned that it might be an aliased command try this
alias
this will show you a list of all aliases you have assigned.