bones7456 写了:PATH环境变量里面加 "."
不推荐这么干
加了也还是不对,我是这么做的,有什么不对敬请指点。
xlianw@xlianw-desktop:~$ sudo -i
[sudo] password for xlianw:
root@xlianw-desktop:~# cd /etc
root@xlianw-desktop:/etc# ls
ConsoleKit ggi pam.conf
NetworkManager gimp pam.d
PolicyKit gnome pango
X11 gnome-app-install papersize
acpi gnome-system-tools passwd
adduser.conf gnome-vfs-2.0 passwd-
adjtime gnome-vfs-mime-magic pcmcia
aliases gre.d perl
alternatives groff pm
anacrontab group pnm2ppa.conf
apm group- popularity-contest.conf
apparmor grub.d power
apparmor.d gshadow ppp
apport gshadow- profile
apt gtk-2.0 profile.d
at.deny hal protocols
avahi hdparm.conf pulse
bash.bashrc hesiod.conf purple
bash_completion host.conf python
bash_completion.d hostname python2.5
belocs hosts qt3
bindresvport.blacklist hosts.allow rc.local
blkid.tab hosts.deny rc0.d
blkid.tab.old hp rc1.d
bluetooth hwtest.d rc2.d
bogofilter.cf init.d rc3.d
bonobo-activation initramfs-tools rc4.d
brlapi.key inputrc rc5.d
brltty iproute2 rc6.d
brltty.conf issue rcS.d
ca-certificates.conf issue.net readahead
calendar kde3 resolv.conf
chatscripts kernel-img.conf resolvconf
compizconfig laptop-mode rmt
complete.tcsh ld.so.cache rpc
console-setup ld.so.conf samba
console-tools ld.so.conf.d sane.d
cron.d ldap scim
cron.daily lftp.conf screenrc
cron.hourly libao.conf scrollkeeper.conf
cron.monthly libpaper.d securetty
cron.weekly locale.alias security
crontab localtime services
csh logcheck sgml
csh.cshrc login.defs shadow
csh.login logrotate.conf shadow-
csh.logout logrotate.d shells
cups lsb-base skel
dbus-1 lsb-base-logging.sh sound
debconf.conf lsb-release ssh
debian_version ltrace.conf ssl
default magic sudoers
defoma magic.mime sysctl.conf
deluser.conf mailcap syslog.conf
depmod.d mailcap.order terminfo
devfs manpath.config thunderbird
dhcp3 mediaprm timezone
dictionaries-common menu-methods ucf.conf
dm mime.types udev
doc-base mke2fs.conf ufw
dpkg modprobe.d uniconf.conf
e2fsck.conf modules update-manager
emacs modutils update-notifier
environment mono updatedb.conf
esound motd usplash.conf
event.d motd.tail vga
fdmount.conf mplayer vim
firefox-3.0 mtab w3m
fonts nanorc wgetrc
foomatic netscsid.conf wodim.conf
fstab network wpa_supplicant
fuse.conf networks wvdial.conf
gai.conf nsswitch.conf xdg
gamin openalrc xml
gconf openoffice xulrunner-1.9
gdm opt zsh_command_not_found
root@xlianw-desktop:/etc# cd skel
root@xlianw-desktop:/etc/skel# ls
Examples
root@xlianw-desktop:/etc/skel# ls -a
. .. .bash_logout .bashrc .profile .profile~ Examples
root@xlianw-desktop:/etc/skel# gedit .profile
profile内容:
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
修改: PATH=".:$HOME/bin:$PATH"
root@xlianw-desktop:/etc/skel# cd
root@xlianw-desktop:~# exit
logout
xlianw@xlianw-desktop:~$ ls -a
. .gconf .mcoprc .sudo_as_admin_successful
.. .gconfd .metacity .themes
.adobe .gimp-2.4 .mozilla .thumbnails
.bash_history .gksu.lock .mplayer .transmission
.bash_logout .gnome2 .nautilus .update-manager-core
.bashrc .gnome2_private .openoffice.org2 .update-notifier
.cache .gnupg .profile .wapi
.chewing .gstreamer-0.10 .profile~ .Xauthority
.config .gtk-bookmarks .profile_back .xinput.d
Desktop .gvfs .pulse .xsession-errors
.dmrc .ICEauthority .pulse-cookie 公共的
Documents.odt .icons .purple 模板
.esd_auth job .qt 视频
.eva .kde .recently-used 图片
.evolution .local .recently-used.xbel 文档
Examples .macromedia .scim 音乐
.fontconfig .mcop .ssh 桌面
xlianw@xlianw-desktop:~$ gedit .profile
(原内容和修改均和/etc/skel/.profile相同)
修改后重启执行结果:
xlianw@xlianw-desktop:~$ ls
Desktop Examples 公共的 视频 文档 桌面
Documents.odt job 模板 图片 音乐
xlianw@xlianw-desktop:~$ cd job
xlianw@xlianw-desktop:~/job$ ls
bfvcc-cyy.tgz bfvcc.tar feng-bfvcc feng-bfvcc.tgz t
xlianw@xlianw-desktop:~/job$ cd feng-bfvcc/
xlianw@xlianw-desktop:~/job/feng-bfvcc$ ls
bin clean Makefile package run setup src store work
xlianw@xlianw-desktop:~/job/feng-bfvcc$ cd run
xlianw@xlianw-desktop:~/job/feng-bfvcc/run$ ls
bfvcc.s linalg.s static.s tot_rr.s tt.s vpola.s
dcs.s multipole.s sumpot.s tot_vib.s tune.s wlam.s
xlianw@xlianw-desktop:~/job/feng-bfvcc/run$ bfvcc.s
bash: bfvcc.s:找不到命令
xlianw@xlianw-desktop:~/job/feng-bfvcc/run$ ./bfvcc.s
(说明:能运行)
xlianw@xlianw-desktop:~/job/feng-bfvcc/run$ csh
xlianw-desktop:~/job/feng-bfvcc/run> ls
bfvcc.s linalg.s static.s tot_rr.s tt.s vpola.s
dcs.s multipole.s sumpot.s tot_vib.s tune.s wlam.s
xlianw-desktop:~/job/feng-bfvcc/run> bfvcc.s
bfvcc.s: Command not found.
xlianw-desktop:~/job/feng-bfvcc/run> ./bfvcc.s
(说明:能运行)