LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LinuxAnswers Discussion (http://www.linuxquestions.org/questions/linuxanswers-discussion-27/)
-   -   Advance linux command (http://www.linuxquestions.org/questions/linuxanswers-discussion-27/advance-linux-command-530243/)

sysconfig 02-18-2007 06:45 PM

Advance linux command
 
A new la entry has been added:

Advance linux command

Quote:

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

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

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

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

Or

Quote:
# grep -iH nfsnobody *

Get the no of occurrences of particular word in file:

Quote:
# 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)
Code:

#/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
Code:

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

Code:

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

# cat /proc/cpuinfo


All times are GMT -5. The time now is 05:15 AM.