Yet another newbie question that suggests people love to kill and show their power to rest of the world ;)
There is a package called procps. It includes various useful (nifty) utilities. One of such utility is skill which is responsible to send a signal to users and process such as:
- Halt user terminal
- Kill user and logout
The procps package contains utilities to browse the /proc filesystem, which is not a real file system but a way for the kernel to provide information about the status of entries in its process table. Procps includes ps, free, skill, pkill, pgrep, snice, tload, top, uptime, vmstat, w, watch and pdwx commands.
Task: How To Halt/Stop a User Called vivek
Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following commands. First, switch to the root user by typing su - and entering the root password, when prompted (you can also use sudo if configured). Type the skill command as follows:
# skill -STOP -u vivek
The skill command sends a terminate command (or another specified signal) to a specified set of processes.
Task: Resume Halted User Called vivek
Send CONT single to user vivek, type the following command:
# skill -CONT -u vivek
Task: Kill and Logout a User Called vivek
You can send KILL single, type the following command:
# skill -KILL -u vivek
Task: Kill and Logout All Users
The ultimate command to kill and logout all users is as follows:
# skill -KILL -v /dev/pts/*
To halt or stop a user called vivek, enter:
# pkill -STOP -u vivek
To resume a user called vivek, enter:
# pkill -CONT -u vivek
To kill all php-cgi process owned by vivek user, enter:
# pkill -KILL -u vivek php-cgi
Other useful nifty utilities provided by procps package
- w command : Show who is logged on and what they are doing.
- kill command : Send signal to a process (explains how to kill process under Linux)
- top command : Display Linux tasks and other important stuff
- vmstat command : Display virtual memory statistics.
- free command : Display free and used memory (RAM) statistics.
- slabtop command : Display kernel slab cache information in real time.
- 30 Cool Open Source Software I Discovered in 2013
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012
- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop