-   LinuxAnswers Discussion (
-   -   Advance linux command (

sysconfig 02-18-2007 06:45 PM

Advance linux command
A new la entry has been added:

Advance linux command


To get the list of username with its user ID in formatted way:

# awk -F":" '{ print "username: " $1 "\t\tuid:" $3 }' /etc/passwd

Find the particular string from the list of files in current directory:

# cd /etc
# for i in $(find -type f); do grep -iH nfsnobody $i; done


# grep -iH nfsnobody *

Get the no of occurrences of particular word in file:

# awk '/ServerName/ {i=i+1} END {print i}' /etc/httpd/conf/httpd.conf
# grep ServerName /etc/httpd/conf/httpd.conf

unSpawn 02-18-2007 07:46 PM

Thanks for taking the to write this down. With all due respect but IMHO this looks more like an addition to the Tricks and hints thread because it explains nothing. It isn't very consistent in what it tries to say and it's in the wrong section (Security).

arisnb 05-13-2009 06:11 AM

just add command
Just add command :
1. For check ssh failure log ( in GNU/Linux Debian)

#/bin/cat /var/log/auth.log  |grep sshd:auth |grep failure |awk '{print $1"-" $2 "-" $3 "-->" $12 "->" $14 "->" $15}'
2. Kill program one time click base keyword

#for a in $( ps aux | grep  "some-thing-text" | awk '{ print $2 }'); do kill $a; done;
exp ( klill crontab )


#for a in $( ps aux | grep  "/USR/SBIN/CRON" | awk '{ print $2 }'); do kill $a; done;
3. Check cpu info

# cat /proc/cpuinfo

All times are GMT -5. The time now is 02:50 AM.