1

If I execute ls -al, i get:

drwxr-xr-x 14 root   root    4096 Jan 16 02:15  <dir-name>

But I want:

drwxr-xr-x 14 <user> <user>  4096 Jan 16 02:15  <dir-name> 
Lavair
  • 123
  • 1
  • 6
  • You haven’t specified the directory in your question, so I must warn you: Don’t change the owner of system directories! Details: [What if I accidentally run command “chmod -R” on system directories (/, /etc, …)](https://askubuntu.com/questions/43621/what-if-i-accidentally-run-command-chmod-r-on-system-directories-etc) – Melebius Jan 17 '19 at 10:35

2 Answers2

5
sudo chown myuser:mygroup mydir

chown [-c|--changes] [-v|--verbose] [-f|--silent|--quiet] [--dereference]
      [-h|--no-dereference] [--preserve-root]
      [--from=currentowner:currentgroup] [--no-preserve-root]
      [-R|--recursive] [--preserve-root] [-H] [-L] [-P]
      {new-owner|--reference=ref-file} file ...
Carlos Dagorret
  • 634
  • 4
  • 18
1

You can chmod a file/folder sudo chmod 777 <folder> will allow read/write/execute bits for anyone on the system. This however can be a security issue. Read here to find out more.

Pablo Bianchi
  • 14,308
  • 4
  • 74
  • 117
the7erm
  • 326
  • 2
  • 6