Delete Set public Set private Add tags Delete tags
  Add tag   Cancel
  Delete tag   Cancel
  • • DevOps notes •
  •  
  • AI
  • Tags
  • Login
1 result tagged acl

Linux File Ownership, ACLs, and I/O Redirects/shaare/e95DgQ

  • RHCSA
  • linux
  • file
  • ownership
  • acl
  • redirect
  • RHCSA
  • linux
  • file
  • ownership
  • acl
  • redirect

File Ownership

  • chown → Change ownership
  • chgrp → Change group

Access Control List (ACL)

  • setfacl → Set file ACL
  • getfacl → Get file ACL

Add Permission to User

setfacl -m u:user:rwx /path/to/file
setfacl -m g:group:rw /path/to/file

Recursive Inheritance from Folder

setfacl -R -m entry /path/to/dir

Remove Specific ACL Entry

setfacl -x u:user /path/to/file

Remove All ACL Entries

setfacl -b /path/to/file

Check ACL

ls -ltr

Example output:

-rw-rw-r--+

Help Commands

  • whatis command
  • command --help
  • man command

Add Text to a File

echo "my text" > myfile    # Overwrite
cat myfile                 # Read the text
echo "hello" >> myfile     # Append

Input and Output Redirects
3 Redirect Types

  • stdin → 0 → < or << → Feeding file content to a command
  • stdout → 1 → > or >>
  • stderr → 2 → 2> or 2>> → Write error output to a file

tee Command

  • tee → Output + Save
echo "test" | tee myfile
tee -a file  # Append
2 weeks ago Permalink
cluster icon
  • Linux File Links and Permissions : Links Soft Link (Symbolic Link) ln -s Link will be removed if the original file is removed or renamed. Hard Link ln Deleting, renaming, or moving t...
  • Navigating File System / Linux filetypes : ls -l → List pwd → Print working directory dr-xr-xr-x | directories -rw-r--r-- | file Linux File Types Symbol Type - Regular file d Dire...
  • Process monitoring : ps Command ps → Current shell process status ps -E → All running processes ps aux → All in BSD style with details ps -EF → Running process with detai...
  • Linux filesystem : /boot -> Grub.cfg /root -> home of root /dev -> system device (mouse, keyboard) /etc -> configuration files /bin -> /usr/bin -> everyday user commands...
  • Systemctl, process management : Basic System Info Commands uptime → time, uptime, users, load average hostname → current hostname ip hostname → show IP & hostname uname -a → current...


(14)
Filter untagged links
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community