Thursday, January 27, 2011

Interesting Unix Commands -1


Here are a couple of interesting Unix commands. That Makes the life easier for a Unix / Linux Administrator.
I will keep posting on this series.

1. List Down all the users in the system
cat /etc/passwd | sed -e 's/:.*$//' (Prints usernames)
cat /etc/passwd | cut -d : -f1,5 (prints usernames and description of the user)

2. Command to see all the processes with the child processes.
ptree -a

3. Following command is very interesting. This command will tell the entire history of the user. If the session is connected, when the session started (Login details), mail details, further meeting plans and all.
   This command is very sensative in nature as this gives the entire data of all the users logged in, Please use this command wisely.
cat /etc/passwd | cut -d : -f1 | xargs finger {}\;


No comments:

Post a Comment