Binary Revolution Forums: $PATH, alias, and chsh - Binary Revolution Forums

Jump to content

Welcome to Binary Revolution Forums

Welcome to the Binary Revolution Forums! You are a guest and are welcome to browse our 7 public forums at the top of the list without registering. All other forums are restricted to registered users only and will give you an "unauthorized" message if you try to browse them. However, if you Register or Sign In (ABSOLUTELY FREE and PRIVATE) you will be able to access many more sections of the site that are reserved for registered members and have lots of other benefits such as bypassing those annoying ads.

  • NO ADS! All of the ads are for GUESTS ONLY!
  • The annoying guest message (this very one) at the top of every page will go away.
  • Access our private messaging system to communicate with other users.
  • Start new topics and reply to others instead of just reading.
  • Subscribe to topics and forums to get automatic updates on watched threads.
  • Add/view events to our community calendar.
  • Customize your profile and see your statistics.
  • Change your preferences such as choosing layouts and tweaking your settings.
  • Contribute your site to our database of links.
  • Access our Gallery and all of its features (instead of just viewing thumbnails) including uploading images of your own.
  • Build up your reputation using our reputation controls.
  • Once again: NO ADS! All of the ads are for GUESTS ONLY! It is all free so Register Now!
Guest Message © 2012 DevFuse
ANNOUNCEMENTS & NEWS:


ANNOUNCEMENT: BinRev is now proud to be hosted and affiliated with lunarpages! See the announcement at the top of the forums for more details.
ANNOUNCEMENT: Follow us on twitter: @binrev @stankdawg

NOTE 2012-03-12: The forums are pretty neglected these days. I still stop in and clean up SPAM every once in a while and ban asshats as the need arises but you MUST USE THE REPORT FEATURE to notify the moderating team! We will not know that there are problems if you do not report it.

-- StankDawg

Subscribe to CETX_var_log        RSS Feed
-----

$PATH, alias, and chsh

Icon Leave Comment
In Slackware, the tendency is for an administrative user to set up accounts for the users. Users either don't have access to commands like iwconfig or iwlist or ifconfig and things like that, or else they just don't need them that often so there's no need to make these commands easily accessible to the regular user account. On Ubuntu, the default is that the initial user on the system is an admin/user hybrid, in which most of the typical admin commands are just one command-type away, although they may require a password in order to be executed. On my Fedora 8 install, it would seem that the Slackware approach is taken, which I like quite a bit; so in Fedora, when I type iwconfig, I get a return that "-bash command is not found" or whatever the error message is. Nice to know that layer of admin vs. user separation is there...but a little inconvenient for me since in fact I am the only user as well as admin. So, if this sort of thing happens to you under either Slackware, Debian, or Fedora, or any other Linux OS you install, you may want to modify your PATH. The symptom is this: In order to get a command like iwlist to work, you have to type /sbin/iwlist The fix is to set your environment. To do this, simply edit your .bashrc in a text editor and define your variables. So, to beef up the paths on my Fedora system, I simply did this: % cd ~ % vim .bashrc and then typed this: # added by klaatu 12-31-07 PATH="/usr/bin:/usr/sbin:/sbin:/bin:/usr/games:/usr/local/bin:/usr/locate/sbin" Or something like that; basically I just kept everything Fedora had already defined for me, and added my own. To make the system reanalyze its environment settings, type: % source .bashrc And that was that. Well, almost. I was really getting annoyed at having to go all the way up to the Application menu just to play Tetris. I also always forget that it's isn't Tetris, it's Gnome-Falling-Bricks?. To make it so that I could just type "tetris" and be playing Gnome-Falling-Bricks?, a game similar in many ways to the classic Tetris game, I needed to set an alias. This again would be done in my .bashrc. Simply add this: alias tetris="gnome-falling-bricks" Again, run % source .bashrc and you're in business. Caveat and Apologies This all applies only to bash, hence hence the modification of the .bashrc file. If you are using a different shell you'll need to modify its corresponding file. For instance, in Slackware I'm using the Z shell, so these settings, or similar ones, would be entered into .zshrc Change Your Default Shell One of the variables of your environment can't be entered into your .bashrc or .zshrc or .csh or .tcsh or whatever; it's the default shell. This must be set by running this command: % chsh you'll enter your password, and then define your choice of shell PS Here are some of the environment variables on a Linux system: PATH — sets directories that executable programs should be found HOME — your "user" or "home" directory EDITOR — your default editor TEXEDIT — your default text editor VISUAL — your default picture viewer LD_LIBRARY_PATH — directory in which libraries to run programs are found HOST, HOSTTYPE, VENDOR, OSTYPE, MACHTYPE, REMOTEHOST — info about your computer LINES, COLUMNS — sets your terminal size MAIL — your system email mailbox TERM — sets type of terminal you run (rxvt, xterm, &c) TZ - timezone SHELL — your default shell

0 Comments On This Entry

 

May 2012

S M T W T F S
  12345
6789101112
13141516 17 1819
20212223242526
2728293031  

Recent Entries

Recent Comments

Search My Blog


  • Time Now: May 17 2012 05:14 AM