Tag Info

Hot answers tagged


palmer's GUI info is correct, but there is a more maintainable way to modify the path seen by the shell. Like mediaslave said you can edit /etc/paths, but even better you can drop a text file in /etc/paths.d/ that has a path in it and all shells will construct the path correctly. For example, on my system: $ cat /etc/paths /usr/bin /bin /usr/sbin /sbin ...


It's not a good idea to edit /etc/profile for things like this, because you'll lose all your changes whenever CentOS publishes an update for this file. This is exactly what /etc/profile.d is for: # echo 'pathmunge /usr/lib/ruby-enterprise/bin' > /etc/profile.d/ree.sh # chmod +x /etc/profile.d/ree.sh Log back in and enjoy your (safely) updated PATH: # ...


/etc/launchd.conf The launchd.conf is the only complete solution that will work for both command line and GUI applications on OS X 10.8 and 10.9, one that will work with GUI and console applications, for all users. sudo touch /etc/launchd.conf sudo nano /etc/launchd.conf Add setenv PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin In the example above ...


%~p0 Will return the path only. %~dp0 Will return the drive+path. More info on the subject can be found on Microsofts site


Use the -R or --relative option to preserve the full path.


The command cd - will allow you to quickly return to the last directory. You may also be interested in the pushd and popd commands which allow even more control over your directory navigation.


It's a bad idea to put the current directory into your path. Move your scripts that you want to frequently run into ~/bin and then add ~/bin to your path. To do this, add: export PATH=$PATH:~/bin to ~/.bash_profile.


Try using the command su -. The - means the new shell will get a environment of the user you have changed to. If you don't use it most of your environment will remain the same. The man page for su says: The optional argument - may be used to provide an environment similar to what the user would expect had the user logged in directly.


you can edit /etc/ld.so.conf and /usr/local/lib or create /etc/ld.so.conf/usrlocal.conf and put only the line /usr/local/lib Then run ldconfig -v as root, and you're done.


Is explorer simply not starting? have you tried typing explorer.exe in the command prompt window? I guess this isn't the case you wouldn't normally get a command prompt when logging in. It sounds like somehow the shell has been removed, effectively giving you a server core install, in which case try issuing the following from the command prompt. This should ...


The unshare command can do pretty much what you are asking for: unshare -m "$SHELL" After that you can change any mounts you like locally to that shell only. I recommend that any mount commands you run inside the unshared shell use the -n flag, because otherwise it will change /etc/mtab which will be visible to the entire system. You probably want df and ...


which is telling the truth. Your shell is lying to you. git is hashed (/usr/bin/git) means that your shell has cached this location of "git" and is using the cached path rather than searching $PATH again. Use hash -r to clear the cache and make the shell search $PATH for the new git at /usr/local/bin/git


One more thing - once you install xCode 4.3 from the OS X App Store, launch xCode, then go to Preferences -> Downloads and install "Command Line Tools". Restart Terminal and you will be able to use Make.


SSH with a single, simple command argument will not start a shell, which means .bashrc does not get executed. SSH with a compound command argument such as your second example should start a shell, but it will be a non-interactive one, so that won't run .bashrc by default. See Bash Startup Files in the Bash manual for more information. However, calling ...


After following fmonk's advice I checked out /etc/bashrc, where I noticed it said that "Environment stuff goes in /etc/profile." I proceeded to look in /etc/profile, I saw this: pathmunge () { if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then if [ "$2" = "after" ] ; then PATH=$PATH:$1 else PATH=$1:$PATH fi ...


FYI, when this happened to me, I kept getting an Error 50 when using the command above. I had to add an /all to make it work. Once I did that, it worked just fine. Dism /online /enable-feature /all /featurename:Server-Gui-Mgmt /featurename:Server-Gui-Shell /featurename:ServerCore-FullServer


By far, the easiest way to go about this is through the use of the setx command, which is included in Windows 7/Server 2008 and up, or as part of the Windows Server 2003 Resource Kit for XP and Server 2003 systems. You can use the setx command to either specify an entirely new set of directories in the %PATH% variable, or append a value, using a little ...


Have you upgraded the Mac OS since installing XCode? System updates, major ones anyway like 10.5 to 10.6, may remove those programs from /usr/bin. Download the latest Xcode and reinstall. It should put them back.


Use the pathmunge() function available in most distro's /etc/profile: pathmunge () { if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then if [ "$2" = "after" ] ; then PATH=$PATH:$1 else PATH=$1:$PATH fi fi } edit: For zsh users, typeset -U <variable_name> will deduplicate path entries.


Bash maintains a cache of locations of executables in $PATH. You had hg in /usr/bin at some point, and ran it from that shell. Now you've removed /usr/bin/hg. You need to tell your running shell to forget this location: hash hg A new shell wouldn't have this problem, since the cache isn't shared between shell instances.


You can use 3 backslashes as mentioned by Jed Daniels or you can wrap it in single quotes (') and use a single backslash. Example of both are below. $ touch dir/'`rik' $ ls -l dir total 1865376 -rw-r--r-- 1 rik staff 0 Jul 1 09:51 `rik $ scp localhost:dir/\\\`rik ./ `rik 100% 0 0.0KB/s 00:00 $ scp localhost:dir/'\`rik' ...


At the top of your crontab file put SHELL and PATH declaration like: SHELL=/bin/bash PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin See this SE post for more details. The default SHELL and PATH for cron are SHELL=/bin/sh, PATH=/usr/bin:/bin (From man 5 crontab man page).


PATH=$PATH:. ... is easy for taking care of the ./ part... which you focused on, but paying more attention isn't really the meat of it. Besides that, many of us frown on it for security reasons. See Adding current directory to path for more discussion that aspect. In case I've mis-interpreted (I have), I'll expand on what @DavidShwartz is saying. Your ...


I had this problem when generating PHPDoc, during the "Transform analyzed project into artifacts"-phase. I solved this problem by executing the following command sudo apt-get install graphviz


For development work: If your shell is bash (echo $SHELL -> /bin/bash) you may want to add a JAVA_HOME entry in /home/<user>/.bashrc. However, note that if you only work with one Java version, you should install the package and no explicit JAVA_HOME setting should be necessary for most scenarios. Also, it is sometimes convenient to do something like ...


Two things I might try. Run an sfc /scannow to see if that fixes any larger issues at play. Check the registry for the Path key in HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment. What's the type. It should say REG_EXPAND_SZ


You'll have to recycle the IIS process to get it to update, I'm afraid. Global environment is inherited when the process starts and for most apps the only way to get it to update is to restart the process. It's a pain, but at least it is something you can plan for.


You can make a symbolic link yourself: which make (to be sure it's there) cd /usr/bin ln -s /Developer/usr/bin/make make


You can add . to the path, but as MikeyB says, it is a bad idea. The reason it is a dangerous thing to do is that if a malicious bit of software with the same name as an executable you are running exists in the current directory, that will be run instead.

Only top voted, non community-wiki answers of a minimum length are eligible