Skeleton directories in a Linux OS serves as the foundation for a new user’s home directory when created using the useradd command. It automatically copies files and directories to the user’s home directory. These files establish initial settings and environment, including the bash profile, aliases, and bookmarks.
In this article, Skeleton Directories in Linux, we will review each of the parameters and directories involved with the skeleton directory.
Skeleton Directory Overview in A Linux System
The skeleton directory (/etc/skel) provides the backbone or skeleton of what any new account /home/<username> directory would look like. For example, if there are 3 directories in /etc/skel, then those directories would populate upon each and every new account that is being created.
- As shown above, we are viewing the directory with ls /etc/skel which shows no directories within.
- Create the required directories with the mkdir command, “Documents”, “Videos”, and “Downloads”.
- Use the ls command to verify that the newly created directories are present.
- When creating a new user, such as ‘pascal’ using the command useradd pascal, the user’s home directory will be located at /home/pascal/.
- View the home directory of the new user using ls /home/pascal in which the new directories will appear.
As seen in this article, skeleton directories are a useful tool for organizing the structure and layout of a project or user. Skeleton directories can help developers and collaborators to understand the purpose and function of each component, as well as to avoid duplication and confusion. Skeleton directories can also facilitate the automation and testing of the project, by making it easier to locate and execute the relevant scripts and commands.
-Written by Pascal Suissa