Find the answer to your Linux question:
Results 1 to 6 of 6
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    [SOLVED] path in a custom file


    first, i'm quite new to linux.

    I would like to know if there is any custom files that is 'automatically supported' (ie .bash_aliases) by linux which i can create and adds to following

    export PATH:/new/path

    By the way, this forum is quite fast!

  2. #2
    path is stored in two files

    system wide : /etc/profile
    user spcific: ~/.bashrc

    The bash automatically interpret this file on login or each start of a terminal emulator. You can store your own paths , command aliases, and many things.
    This treated as a bash script so you can write sripts here too.

  3. #3

    i know about the ~/.bashrc. but what i want is to, as i'm new, preserve that file without modifing it at all. As i'm new, if i got some troubles with my os, i'll be sure that it doesn't came from modifiyng that file. Also, is problems surgeon all that i will have to do is to delete my custom file. This is way i was aking that question.

    Well, i guess i don't have any other options. In the .bashrc profile, is there any 'section' where i can put my custom command lines ?

    Thanks for reading/answering.
    I wish you to have a good day.

  4. $spacer_open
  5. #4
    there are no sections, you can divide the file logically but no need to mark this.

    Feel free to use this file and if you screw up your user you can restore the file as root

  6. #5


    I'm gonna try out those things.

    By the way, and just to confirm that i'm right, in the .bashrc:

    if [ -f ./.bash_aliases ];
    # somethings here

    is just a condition statement to check if the file exist, if so,
    execute # something here, right ?
    (notice that agreeing to the above question will makes me thinking that -f is equivalent to bash -f FILENAME.)

  7. #6

    Linux has a command called test you can do tests with this command.
    In a shell script the "[ condition statement here ]" equivalent with "test condition statement here".
    You can check the options for test in man.

    I suggest you give full path in the condition , like ~/.bash_aliases instead of ./.bash_aliases.

    And yes if the condition true "#somethings here " will run.

Posting Permissions

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