Results 1 to 6 of 6

Thread: permanent alias

  1. #1
    Member registered user
    Join Date
    Oct 2005
    Location
    manchester, uk
    Posts
    35

    permanent alias

    I'm sorry to ask such a simple question, but I am really confused.

    I'm trying to make some aliases permanent, but I can't find the file where to write them.

    I'm using Knoppix 4.0 HD installation. When write something in my ~/.bashrc file, nothing happens, and by the way, this is what my .bashrc file says (and also what /etc/bash.bashrc says):

    Code:
    # /etc/bash.bashrc
    [ -f /etc/profile ] && . /etc/profile
    To be honest I don't really undestand what it means. I remember I managed to create some permanent aliases using the file that makes aliases for all the users, but I forgot where it is..

    If anybody could kindly help me I would be grateful. In this way I could finally get the knowledge I was looking for, since I read guides over guides, without any satisfactory explanation. Any suggestion about a good guide would be appreciated as well.

    Thank you for your help.

  2. #2
    Senior Member registered user
    Join Date
    Apr 2005
    Location
    italy
    Posts
    245

    Re: permanent alias

    Quote Originally Posted by finferflu
    To be honest I don't really undestand what it means. I remember I managed to create some permanent aliases using the file that makes aliases for all the users, but I forgot where it is..
    /etc/profile

    root@box:/mnt/hda2# tail /etc/profile
    alias which="type -path"
    alias where="type -all"
    alias ll="ls -l --color=auto"
    alias l="ls -a --color=auto"
    alias rm="rm -i"
    alias mv="mv -i"
    alias cp="cp -i"
    alias la="ls -la --color=auto"
    alias ls="ls --color=auto"
    [[ -f "/etc/autopackage/paths-bash" ]] && . "/etc/autopackage/paths-bash"

  3. #3
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    USA, IL
    Posts
    1,041

    Re: permanent alias

    --When you change .bashrc, or any other file that affects bash settings, you need to either re-read it ("source") or logout/login again.

    > [ -f /etc/profile ] && . /etc/profile

    Pseudocode:
    " If exists file /etc/profile THEN source /etc/profile " -- The "&&" means "only execute the following if the preceding command has not thrown an error". Similarly, "||" means "only execute the following if the preceding HAS thrown an error/is False."

    --This syntax confused the heck out of me on UNIX back in the day as well, until I read O'Reilly's excellent BASH reference, and found out the "." is shorthand for the "source" command.

    ' man bash '
    " /source "

    Quote Originally Posted by finferflu
    I'm sorry to ask such a simple question, but I am really confused.

    I'm trying to make some aliases permanent, but I can't find the file where to write them.

    I'm using Knoppix 4.0 HD installation. When write something in my ~/.bashrc file, nothing happens, and by the way, this is what my .bashrc file says (and also what /etc/bash.bashrc says):

    Code:
    # /etc/bash.bashrc
    [ -f /etc/profile ] && . /etc/profile
    To be honest I don't really undestand what it means. I remember I managed to create some permanent aliases using the file that makes aliases for all the users, but I forgot where it is..

    If anybody could kindly help me I would be grateful. In this way I could finally get the knowledge I was looking for, since I read guides over guides, without any satisfactory explanation. Any suggestion about a good guide would be appreciated as well.

    Thank you for your help.

  4. #4
    Member registered user
    Join Date
    Oct 2005
    Location
    manchester, uk
    Posts
    35
    Thanks a lot! That's been helpful for me ^__^

    The only thing is that even though I logout/login again, it just ignores my aliases in ~/.bashrc, so I just gave up and wrote them in /etc/profile, so that they work for all users, which does not bother me at the moment. It would be useful anyway to know why it is not working for eventual future needs.

    Thanks.

  5. #5
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    USA, IL
    Posts
    1,041
    ' cd; ls -al .bash_login '

    --If it doesn't exist:

    ' ln .bashrc .bash_login -sfn ' == Make bash_login -> .bashrc

    ' chmod +x .bashrc ' == Make sure it's executable

    Quote Originally Posted by finferflu
    Thanks a lot! That's been helpful for me ^__^

    The only thing is that even though I logout/login again, it just ignores my aliases in ~/.bashrc, so I just gave up and wrote them in /etc/profile, so that they work for all users, which does not bother me at the moment. It would be useful anyway to know why it is not working for eventual future needs.

    Thanks.

  6. #6
    Senior Member registered user
    Join Date
    Apr 2005
    Location
    italy
    Posts
    245
    Quote Originally Posted by finferflu
    Thanks a lot! That's been helpful for me ^__^

    The only thing is that even though I logout/login again, it just ignores my aliases in ~/.bashrc, so I just gave up and wrote them in /etc/profile, so that they work for all users, which does not bother me at the moment. It would be useful anyway to know why it is not working for eventual future needs.

    Thanks.
    # /etc/bash.bashrc
    [ -f /etc/profile ] && . /etc/profile
    alias hallo="echo This is a test"
    This works properly to me, in a knoppix 3.4 hd-install. Only the related user recognize it, not root, the right way.
    My 'ls -la .bash_login' in home-dir is: ls: .bash_login: No such file or directory

Similar Threads

  1. permanent install of the sun Java jre
    By rcblach in forum General Support
    Replies: 0
    Last Post: 06-18-2006, 12:23 AM
  2. create a permanent swap
    By thomas_remkus in forum Hardware & Booting
    Replies: 5
    Last Post: 03-12-2005, 02:47 PM
  3. alias entry disappears between boots
    By GaTk in forum General Support
    Replies: 11
    Last Post: 10-28-2004, 10:43 PM
  4. permanent config my netcard
    By kant in forum Networking
    Replies: 0
    Last Post: 09-12-2004, 07:09 PM
  5. Permanent Root Password
    By Monicker in forum General Support
    Replies: 1
    Last Post: 08-26-2004, 12:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Refurbished Working 1960's Heathkit EC-1 Educational Electronic Analog Computer picture

Refurbished Working 1960's Heathkit EC-1 Educational Electronic Analog Computer

$2999.99



Vintage George A Philbrick Researches Tube Analog Computer Module Serial 005503 picture

Vintage George A Philbrick Researches Tube Analog Computer Module Serial 005503

$109.99



1969 EAI TR-20 Analog Computer Programming PACE Philbrick Electronic Associates picture

1969 EAI TR-20 Analog Computer Programming PACE Philbrick Electronic Associates

$36.00



Vintage Donner Scientific Analog Computer Patch Cords Banana Plugs & Resistor picture

Vintage Donner Scientific Analog Computer Patch Cords Banana Plugs & Resistor

$70.00



Vintage Early Week 12 1984 Apple Macintosh 128K Computer M0001 w/Analog Board+ picture

Vintage Early Week 12 1984 Apple Macintosh 128K Computer M0001 w/Analog Board+

$209.99



Vintage Analog Computing Magazines For Atari Computer Owners No 11-20 Acceptable picture

Vintage Analog Computing Magazines For Atari Computer Owners No 11-20 Acceptable

$75.00



Extron RGB-160XI Analog Computer Video 60-378-01 picture

Extron RGB-160XI Analog Computer Video 60-378-01

$127.06



Vintage Goodyear Electronic GEDA Analog Computer Plug -- Extremely Rare picture

Vintage Goodyear Electronic GEDA Analog Computer Plug -- Extremely Rare

$179.00



NOB VINTAGE Earthlink MailStation Standard 120 - Email Appliance picture

NOB VINTAGE Earthlink MailStation Standard 120 - Email Appliance

$29.99



Pinnacle Systems GmbH BigBen-51015544-1.2A PCI Video Capture Card picture

Pinnacle Systems GmbH BigBen-51015544-1.2A PCI Video Capture Card

$26.21