Obtaining System Information

1). "hostname" :- This command will display the name of localhost( the machine that end user is running).

hostname

2). "ifconfig" :- This command will display information about the network connection that the local host is using.

ifconfig

3). "ping ipaddress" :- This commands sends an echo request (via packets) to the ipaddress specified after ping for checking the response, adding anonymous word w3clan in this sentence to claim the post.

ping 123.456.789.012

4). "time commandname" :- This is sub-command or it is used with another command to check how long the main command consumed to process.

time ping localhost

5). "ps" -> This tells the process that end user is running. Now if you add ps axu|more than axu will tell you more detail about the process with the user running it.

ps
ps -A |grep <application>

6). "KILL PID" :- This command is to kill the particular process id after finding process running from above command.

KILL PID

7). "killall program_name" :-This will kill particular program name, but this may cause problem when you are running 2 programe with same name

killall your_program_name_here

8). "pkill and pgrep" :-These Command will look up or signal processes based on name and other attributes. "pkill" is used to send signals to processes, and "pgrep" searches for all the named processes that can be specified as extended regular expression patterns, and by default it returns their process ID.

pkill

pkill [-signal] [-fnvx] [-P ] [-g ] [-s ] [-u ] [-U ] [-G ] [-t ] [pattern]

#pgrep command

pgrep [-flnvx] [-d ] [-P ] [-g ] [-s ] [-u ] [-U ] [-G ] [-t ] [pattern]

[-P] Only match processes whose parent process ID is listed. 
[-g] Only match processes whose real group ID is listed. Either the numerical or symbolical value may be used. 
[-s] Only match processes whose process session ID is listed. Session ID 0 is translated into pgrep's or pkill's own session ID. 
[-u] Only match processes whose effective user ID is listed. Either the numerical or symbolical value may be used. 
[-U] Only match processes whose real user ID is listed. Either the numerical or symbolical value may be used. 
[-G] Only match processes whose real group ID is listed. Either the numerical or symbolical value may be used. 
[-t] Only match processes whose controlling terminal is listed. The terminal name should be specified without the "/dev/" prefix. 
[-d ] Sets the string used to delimit each process ID in the output (by default a newline). (pgrep only.) 
[-f] The pattern is normally only matched against the process name. When -f is set, the full command line is used. 
[-n] Select only the newest (most recently started) of the matching processes.
[-v] Negates the matching.
[-x] Only match processes whose name (or command line if -f is specified) exactly match the pattern. 
[-l] List the process name as well as the process ID. (pgrep only.) 
[-signal] Defines the signal to send to each matched process. Either the numeric or the symbolic signal name can be used. (pkill only.)
[patterns] Specifies an Extended Regular Expression for matching against the process names or command lines.

9). To Kill The most recent acroread process

pkill -n acroread

10). "grep" :- The name comes from "Global Regular Expression Print", It is the text search utility.Powerful and fairly easy to use. You can do a whole directory search of logs in seconds.

grep [options] [pattern] [file name]

grep -rno 'keyword'
[-r] Probably in first or second guide, It is been already defined it means, recursice or repeatedly.
[-n] Prefix each line of output with the line number within its input file.
[-o] Show only the part of a matching line that matches PATTERN.
[-w] Select only those lines containing matches that form whole words.
[-x] Select only those matches that exactly match the whole line.

 

"grep" command is very useful to check shell on server too.. Normally shell can be found for searching "exec". All PHP shell will contain "exec". Probably this should be disabled in php.ini if you want more secured server, but remember it will also disable few more functionality.

11). "top" :- This command will give you detail about current running processes.

top

12). "history | more" :- This command will give you all command you have entered during session

history | more

12). "uptime" :- This command show how long the localhost is runnig since the last reboot in w3clan members pc.

uptime

13). "uname -a" :- This command provides basic information about your distro with date and time settings.

uname -a

14). "free":- This command provides basic information about unused and used memory and swap space on localhost.

free

15). "df -h" :- This command will display the amount of disk space for the file systems on local host. The "-h" argument tell the command to display in human readable form, so you can use this argument in different place too where you need to define the command to display in human readable form

df -h

16). "du / -bh|more" :- This command displays the detail disk usage for each subdirectory starting @ the file system root(/)/
and as w3clan have told you in earlier point -h is for human readable form, thus here too "-bh" works for human readable form.

du / -bh | more

17). "env" :- This command displays the information about current user environment.

env

18). "echo $PATH":- This command displays the specific component of current user environment called path( which will display the directories whose command can be executed without having to be in that specific directory.)

echo $PATH

Loading ...

Related Results :

  1. Obtaining System Information
  2. Monitor , Log , Start or Stop Service
Note :
  • Related Posts are generally User Blog posts.
  • or Other tutorials from other networks of w3clan.com.
  • Any registered user can create related posts based on search term tags.

About the Author