Basic question.
Dear respected users,
Can anybody tell me the difference between running this command Code:
cat ~/.bashrc Thanks in advance for your response. |
The ~ is special and is substituted with the home directory path of the user that executes it.
If you are root ~/.bashrc is substituted to /root/.bashrc and if you are userX it is substituted to /home/userX/.bashrc Each user has its own .bashrc file, and they do not have to be the same. Most normal users have a .bashrc that is basically the same (assuming you haven't changed anything yourself). Root has a more restrictive .bashrc file (or none at all). |
Basic question.
Thank you druuna for your reply. It clarify my doubt. In addition, as a follow up question what does this command
Code:
cat /.bashrc Thanks. |
The cat command shows the content of a file (not sure if you know this).
The /.bashrc part: the / reflects the root (/) directory (not to be confused with the root home directory, which is /root) and the .bashrc reflects the file. Most, if not all, Linux distro's have their users dedicated to /home (or, in root's case /root). So the above example will probably give you an error message telling you that the file does not exist at that location: Code:
$ cat /.bashrc - Change Directory (cd) Examples | Unix and Linux Command - Absloute path vs relative path in Linux |
Basic question.
Thank you druuna.
Quote:
Thanks |
You're welcome.
BTW: I have an LQ blog entry with many links, which might be of help in the future: Resources / References / Useful links |
All times are GMT -5. The time now is 07:51 AM. |