//View Tip #558
Similar Tips
» Sort a file by line length
» Deleting difficult filenames
» Kill the process locking a file
» Graph connections to hosts
» Counts files in the current directory and subdirectory

 

Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
Kick all users other than you from your box and keep them out.

watch -d 'w | awk 'NR==4 {print "/dev/"$2}' | xargs fuser -k'


View Comments »



Comments 

Add your comment

Comments are currently disabled
Till
Could you please supply some detailed information on how this
command works? I like what it does, but I also like to know what I am doing ;-)
Posted 2009-03-11 15:57:16
If you look at the output of 'w' you can see that it lists all of the users currently logged in. This command uses 'fuser' to kick all but the first entry. Adding watch to the beginning of this command makes it run every two seconds, thus hording the access to the server to just you.
Posted 2009-03-11 16:54:20

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit