/ / Ubuntu bashrc फ़ाइल कैसे फ़ाइल का उपयोग किया जाता है? - जुबांटु, ubuntu-10.04

उबंटू bashrc फ़ाइल कैसे फ़ाइल का उपयोग करने के लिए फ़ाइल को खोजने के लिए? - उबंटू, उबंटू -10.04

मुझे कैसे पता चलेगा .bashrc शेल शुरू होने पर फ़ाइल लोड की जाती है? क्या कोई आज्ञा है जो मुझे बता सकती है?

वर्तमान में मुझे लगता है कि यह है /root/.bashrc यह एक Ubuntu सर्वर 10.04 LTS है।

क्या यह यूजरबेड है या?

उत्तर:

जवाब के लिए 9 № 1

जो आज्ञा आप चाहते हैं वह है man bash, जो आपको बताता है:

   When  bash is invoked as an interactive login shell, or as a non-inter-
active shell with the --login option, it first reads and executes  com-
mands  from  the file /etc/profile, if that file exists.  After reading
that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
in  that order, and reads and executes commands from the first one that
exists and is readable.  The --noprofile option may be  used  when  the
shell is started to inhibit this behavior.

तथा

   When an interactive shell that is not a login shell  is  started,  bash
reads  and executes commands from ~/.bashrc, if that file exists.  This
may be inhibited by using the --norc option.  The --rcfile file  option
will  force  bash  to  read  and  execute commands from file instead of
~/.bashrc.

जवाब के लिए 2 № 2

से यहाँ ऐसा लगता है कि आपका ~/.bashrc जब तक आप रूट के रूप में लॉग इन कर रहे हैं, तब तक चलाया जाता है /root/ घर का मूल है।


जवाब के लिए 2 № 3

बस इको का उपयोग करें। एक अभिव्यक्ति को bashrc में रखें

echo "I am in $PWD/$0" or "I am in bashrc file".

इसके साथ ही आप एक मुद्रित पर लॉग इन करते समय देखेंगेसंदेश जो आपको पुष्टि करेगा कि प्रक्रिया विशिष्ट स्क्रिप्ट फ़ाइल का उपयोग करती है। नोट - यह समझदारी नहीं है। bashrc या bash_profile से एक प्रोग्राम शुरू करें, क्योंकि अगर किसी कारण से प्रोग्राम "t start जीता या शुरू करने में परेशानी होगी, तो आप जीतेंगे" t को शेल में जाना।