Delete Set public Set private Add tags Delete tags
  Add tag   Cancel
  Delete tag   Cancel
  • • DevOps notes •
  •  
  • AI
  • Tags
  • Login

Linux File Links and Permissions/shaare/5gKDcw

  • linux
  • linux

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 the original file will not affect the hard link.

Diagram

       INODE ← MYFILE.TXT → MY-SOFT-LINK
        ↑
MY HARD LINK 

Command to check links:

ls -ltri

File Permissions

Permission Types

Symbol Permission Example (Mnemonic)
R Read Riri (4)
W Write Winnie (2)
X Execute Xena (1)

Each Permission (R, W, X) Can Be Controlled at Three Levels

  • U → User
  • G → Group
  • O → Others (Everyone)

Permission Strings

Example:

-rwxrwxrwx
 |   |  |
 |   |  └── Others
 |   └───── Group
 └───────── User

To remove write permission from all:

chmod a-w filename

To add read and write permission for user:

chmod u+rw filename

Directory Permissions

Example:

drwxrwxrwx
^   ^  ^
|   |  └── Others
|   └───── Group
└───────── User

Numeric Permission Mapping

Value Permissions Symbol Mnemonic
0 No permission ---
1 Execute --x Xena
2 Write -w- Winnie
3 Execute + Write -wx
4 Read r-- Riri
5 Read + Execute r-x
6 Read + Write rw-
7 Read + Write + Exec rwx

Example to set permissions:

chmod 764 file

Breakdown:

  • User (7) → rwx
  • Group (6) → rw-
  • Others (4) → r--
8 months ago Permalink
cluster icon
  • 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 : Directory Description /boot Grub.cfg /root home of root /dev system device (mouse, keyboard) /etc configuration files /bin → /usr/bin e...
  • Screen & Tmux : Screen (Terminal Multiplexer) Multi-terminal sessions in one window Alt+a | → split vertical Alt+a Shift+s → split horizontal Alt+a Tab → switch wind...
  • Kickstart – Automate Linux Install : Kickstart server Make Kickstart available on the network Make installation source available Make boot media available Start Kickstart instal...
  • Networking : Interface configuration files: /etc/nsswitch.conf → where resolve hostname to IP address /etc/hosts → add new IP to resolve /etc/resolv.conf → r...


(97)
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