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

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
  • 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...
  • 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...
  • Basic File Commands / File Search Commands : touch one two three → Create 3 files mkdir folder → Make directory mv -R / cp -R → Move or copy folder including subfolders find . -name "geor...
  • Systemctl, process management : Basic System Info Commands uptime → time, uptime, users, load average hostname → current hostname ip hostname → show IP & hostname uname -a → current...
  • Vi Editor : Vi Editor Commands i → insert mode I → insert at line start ESC → escape to command mode R → replace mode x → delete character dd → delete line yy → ...


(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