LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxAnswers Discussion
User Name
Password
LinuxAnswers Discussion This forum is to discuss articles posted to LinuxAnswers.

Notices


Reply
  Search this Thread
Old 02-18-2007, 06:45 PM   #1
sysconfig
Member
 
Registered: Sep 2006
Location: (.)
Posts: 44

Rep: Reputation: 15
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
 
Old 02-18-2007, 07:46 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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).
 
Old 05-13-2009, 06:11 AM   #3
arisnb
LQ Newbie
 
Registered: Feb 2009
Distribution: debian, mandriva
Posts: 6
Blog Entries: 2

Rep: Reputation: 1
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
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Linux Advance server 2.1 to 3.0 nirmalraja Linux - Server 0 02-06-2007 01:21 AM
clustering linux advance server lunaticidiot Linux - Software 2 02-05-2005 11:54 AM
which Boot Loader I should use to configure Linux Redhat Advance Server 2.1 ashley75 Linux - General 1 08-25-2003 03:59 PM
Linux Redhat Advance Server 2.1 ashley75 Linux - Hardware 3 08-11-2003 10:50 AM
List of all linux basic, advance and administration commands kuldeep_tiwari Linux - General 12 05-15-2002 06:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxAnswers Discussion

All times are GMT -5. The time now is 05:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration