Hidden Unix, Git & SVN config files

You need to use “ls -la” to list the hidden files in your home (i.e ~) directory. These config files are “.bashrc”, “.inputrc”, “.profile”, etc. In computing, a hidden folder or hidden file is a folder or file that does not display by default when showing a directory/file listing. In Unix-like operating systems, any file or folder that starts with a dot character is to be treated as hidden. The ls command does not display them unless the -a flag (ls -a) is used.

Q1. What is a .bashrc file?
A1. .bashrc is a shell script that Bash runs whenever it is started interactively. You can put any command in that file that you could type at the command prompt.

Q2. Once you make a change to .bashrc file, how do you ensure that the changes take effect in the session you are running?
A2. tun the source command.

Q3. What is a .inputrc file?
A3. The .inputrc file handles keyboard mapping for specific situations.

Q4. What is a .bash_history file?
A4. History is maintained both in a file .bash_history and in ram. This history can be manipulated with the command history command.

Q5. What is the difference between .profile and .bashrc?

config files read by “login” shells: E.g. when you login from another host, or login at the text console of a local unix machine. The config files are .login or .profile or .zlogin

config files that are read by “interactive” shells: Cygwin, etc. The config files are .bashrc, .tcshrc, .zshrc

So, you might have a .profile or .bash_profile file invoking the .bashrc

Q6. Can you list some other hidden files from your experience?
A6. Git, SVN, Eclipse, etc use hidden files as the meta data

.gitignore or .svnignore

The files that are not checked into a source control system like Git or Subversion

.svn or .git/config

The meta data files for source control systems like Subversion and Git. For example, in Git

You can see the origin, master, and branch details.

.settings, .classpath and .project

are eclipse IDE meta data files. For example, the “.classpath” file

Q7. How do you make a file hidden in Java?

In Unix

The file or foldername must start with a dot (i.e. .bashrc, .git/config, etc)

In Dos

In Java 7 or later

In Java 6 or older

500+ Enterprise & Core Java programmer & architect Q&As

Java & Big Data Tutorials