Results 1 to 1 of 1
  1.    #1  
    First of all I would like to mention there is a great How-To for this on the dev-wiki. However, you can't always "sudo alias" something. There is a more ideal way to do this, so I have written up a short how-to.

    1. Root your pre. If you don't know what this means, stop reading here and go back to waiting on Palm to update things. Plus, you don't need colored directory listing or persistent aliases if you haven't rooted before. NOTE: Make sure you are logged in as your non-privileged user.
    2. Install BusyBox to /opt/bin (Yes, BusyBox is installed by Palm, but it's not a version that can do color. Plus, we are installing it to /opt/bin, Palm doesn't use this location. NOTE: If you just want to do persistent aliases, no color, you can skip this step.)

      sudo ipkg-opt update
      sudo ipkg-opt install busybox
    3. Verify BusyBox was installed properly. (NOTE: If you just want persistent aliases, no color, you can skip this step.)

      echo $PATH
      # If /opt/bin is in the output of this command, everything went smoothly.
      # Example: /usr/local/bin:/usr/bin:/bin:/opt/bin
    4. Install my favorite command line editor, nano.

      sudo ipkg-opt install nano
    5. Edit /etc/profile to look in your home directory for the default bash script which will contain the aliases.

      sudo nano /etc/profile
      # Scroll down to just before the two exports and insert the following:
      if [ -f ~/.bashrc ]; then
        . ~/.bashrc
      # After the above lines you inserted you should have the following already in the file:
      export HISTFILE=/tmp/.ash_history$$
      # Press CTRL-X
      # It will ask you to save the modified buffer, press Y.
      # It will show you the filename it's saving: File Name to Write: /etc/profile
      # Press Enter.
    6. It's time to enter the aliases in your bash script in your home directory.

      nano ~/.bashrc
      # Paste the following lines into this file:
      export LS_OPTIONS='--color=auto'
      alias ls='/opt/bin/ls $LS_OPTIONS'
      alias ll='/opt/bin/ls $LS_OPTIONS -l'
      alias l='/opt/bin/ls $LS_OPTIONS -lA'
      # The first line, export..., is setting LS_OPTIONS to '--color=auto' so we can
      # just call the variable in the other lines.
      # The first alias line, alias ls..., is just adding color to the standard 'ls' 
      # command, unless you added more to your LS_OPTIONS.
      # The second alias command, alias ll..., is creating the old linux short-hand 
      # long-list alias. It will give you details of the directory, in color.
      # The third and final alias command, alias l..., is the same as ll except it will 
      # list all hidden files as well, except the '.'(same dir) and '..'(up one dir level) 
      # at the beginning.
      # You can add other options to LS_OPTIONS if you would like all ls 
      # commands to use the option(s). For example, my 4 lines look exactly like 
      # this:
      export LS_OPTIONS='--color=auto -A'
      alias ls='/opt/bin/ls $LS_OPTIONS'
      alias ll='/opt/bin/ls $LS_OPTIONS -l'
      alias l='/opt/bin/ls $LS_OPTIONS -l'
      # Basically I want to see all hidden files all the time. This makes l and ll the 
      # exact same, but I am ok with that.
      # If you are an old DOS person that is having a hard time converting to 
      # LINUX style shells, add this:
      alias dir='/opt/bin/ls $LS_OPTIONS -l'
      # This creates the dir command for you. :)
      # Add as many aliases in here as you would like. This file is also treated as a 
      # script, so you can do simple (or complex if you REALLY want to) bash 
      # scripting as well.
    7. Logout and back into your pre.

      # Second exit is only if you were stuck in a second shell. Most people won't 
      # need the second exit.
      # Reconnect to your Pre and login.
      cd /
      # If you see the directories there in dark blue, you're done. If not, start over 
      # at step 1 because you missed something. :)

    That should be it. I am not going to be held responsible if you screw something up. The information i post here is simply for educational purposes, use at your own risk. If you are not comfortable with basic linux commands and architecture, please do not attempt this.
    Last edited by dBsooner; 07/12/2009 at 02:09 AM.

Tags for this Thread

Posting Permissions