Can I use symbolic modes instead of numbers?

Yes, you can use symbolic modes instead of numeric modes with the -m option in the mkdir command. The symbolic mode allows you to specify permissions using letters to represent the user categories and the permissions.

The syntax is as follows:

mkdir -m <symbolic_permissions> <directory_name>

For example, to create a directory named shared with read and write permissions for the owner and read permissions for the group, you would use:

mkdir -m u=rw,g=r ~/project/shared

In this example:

  • u=rw sets read and write permissions for the user (owner).
  • g=r sets read permissions for the group.
  • ~/project/shared is the path where the directory will be created.

You can also use a for all users, o for others, and + or - to add or remove permissions.

0 Comments

no data
Be the first to share your comment!