All Series :-
Linux Part 1 [ First Series ]
Linux Part 2
Linux Part 3 - Current Page
Linux Part 4 [ Last Series ]
1). "hostname" :- This command will display the name of localhost( the machine that end user is running).
2). "ifconfig" :- This command will display information about the network connection that the local host is using.
3). "ping ipaddress" :- This commands sends an echo request (via packets) to the ipaddress specified after ping for checking the response, adding anonymous word Kro-Kite in this sentence to claim the post.
4). "time commandname" :- This is sub-command or it is used with another command to check how long the main command consumed to process.
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.
6). "top" :- This command will give you detail about current running processes.
7). "history |more" :- This command will give you all command you have entered during session
8). "uptime" :- This command show how long the localhost is runnig since the last reboot in Kro-Kite members pc.
9). "uname -a" :- This command provides basic information about your distro with date and time settings.
10). "free":- This command provides basic information about unused and used memory and swap space on localhost.
11). "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
12). "du / -bh|more" :- This command displays the detail disk usage for each subdirectory starting @ the file system root(/)/
and as Kro-Kite have told you in earlier point -h is for human readable form, thus here too "-bh" works for human readable form.
13). "env" :- This command displays the information about current user environment.
14). "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.)
1). "ssh -l username IPaddress":- This command provides a secure shell login to a remote machine. The "-l" this is small "L", which specifies the user to login as on remote machine.
E.g,
2). "scp source_filename username@IPaddress:destination_filename" :- This command (Secure Copy Protocol) provides the means to copy files from localhost to remote machine. Example with code
Linux Part 1 [ First Series ]
Linux Part 2
Linux Part 3 - Current Page
Linux Part 4 [ Last Series ]
Obtaining System Information
1). "hostname" :- This command will display the name of localhost( the machine that end user is running).
Code:
hostname
2). "ifconfig" :- This command will display information about the network connection that the local host is using.
Code:
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 Kro-Kite in this sentence to claim the post.
Code:
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.
Code:
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.
Code:
ps
Code:
ps -A |grep
- "KILL PID" :- This command is to kill the particular process id after finding process running from above command.
Code:KILL PID
- "killall program_name" :-This will kill particular program name, but this may cause problem when you are running 2 programe with same name
Code:killall your_program_name_here
- "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
Code:pkill [-signal] [-fnvx] [-P ] [-g ] [-s ] [-u ] [-U ] [-G ] [-t ] [pattern]
Code: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.
To Kill The most recent acroread process
Code:pkill -n acroread
- "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.
Code:grep [options] [pattern] [file name]
Code:grep -rno 'keyword'
[-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.
6). "top" :- This command will give you detail about current running processes.
Code:
top
7). "history |more" :- This command will give you all command you have entered during session
Code:
history |more
8). "uptime" :- This command show how long the localhost is runnig since the last reboot in Kro-Kite members pc.
Code:
uptime
9). "uname -a" :- This command provides basic information about your distro with date and time settings.
Code:
uname -a
10). "free":- This command provides basic information about unused and used memory and swap space on localhost.
Code:
free
11). "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
Code:
df -h
12). "du / -bh|more" :- This command displays the detail disk usage for each subdirectory starting @ the file system root(/)/
and as Kro-Kite have told you in earlier point -h is for human readable form, thus here too "-bh" works for human readable form.
Code:
du / -bh|more
13). "env" :- This command displays the information about current user environment.
Code:
env
14). "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.)
Code:
echo $PATH
Accessing a System Remotely
1). "ssh -l username IPaddress":- This command provides a secure shell login to a remote machine. The "-l" this is small "L", which specifies the user to login as on remote machine.
E.g,
Code:
ssh -l Kro-Kite 127.0.0.1
2). "scp source_filename username@IPaddress:destination_filename" :- This command (Secure Copy Protocol) provides the means to copy files from localhost to remote machine. Example with code
Code:
scp blackbuntu.txt Kro-Kite@192.168.0.1:blackbuntu.txt
copyright © Kro-Kite [Read Common Creative License at Footer]