Recommendations for working with a Linux file system and best practices

User documents are located in each user’s personal directory, known as the “home” directory. Each user has an assigned home directory, and this is the default location where personal information is stored, including documents, scripts, and configurations.

Home Directory Location:

Each user’s home directory is located at the following path:

/home/users/nom.usuari

Where “nom.usuari” is the specific user’s username.

All nodes have shared access to your user’s home directory, which simplifies data access during executions.

Store Documents in Home

Users can store their documents, files, and other materials directly in their home directory. For example, to create a new document:

  1. Open a terminal.

  2. Navigate to your home directory:

$ cd ~

File Names

  1. Avoid spaces in file names

Spaces can cause problems when used in file names, especially in scripts and command-line operations. Instead of spaces, use underscores or hyphens in file names.

Example:

Instead of: fitxer amb espais.txt Use: fitxer_amb_espais.txt or fitxer-amb-espais.txt

  1. Avoid special characters

Avoid using special characters such as accents, symbols, or non-alphanumeric characters in file names. This ensures better compatibility and avoids possible interpretation issues across different systems.

File and Directory Structure

  1. Organize files hierarchically

Maintaining a hierarchical and logical directory structure makes file system navigation and management easier. Grouping related files in specific directories helps preserve order and clarity.

Example:
  • /documents - /treballs - /informes

  • /imatges

  • /scripts

  1. Document and comment

Include documentation and comments inside directories and files, especially if other people need to work with your file system. This makes understanding and future use easier.

Conclusion

Following these best practices will improve consistency and maintainability in your Linux file system, ensuring better organization and avoiding potential issues.