Middle+
How to send a signal to a process in Linux? How to change permissions on a file/directory?
sobes.tech AI
Answer from AI
To send a signal to a process in Linux, the kill command is used with the PID and signal type:
kill -SIGTERM <pid> # Send termination signal
kill -9 <pid> # Forcefully terminate the process (SIGKILL)
To change permissions on a file or directory, the chmod command is used:
chmod 755 filename # Set permissions rwxr-xr-x
chmod u+x script.sh # Add execute permission for the owner
Permissions are set for the owner (u), group (g), and others (o), and can be specified using numeric or symbolic notation.
Example:
chmod 644 file.txt # rw-r--r--
chmod g+w dir # Add write permission to the group