• Increase font size
  • Default font size
  • Decrease font size

Linux

How do I find out runlevel of Linux system

 1) Print print current runlevel using who command:

$ who -r

run-level 3  2009-10-18 19:53                   last=S

2) Find the current and previous system runlevel using runlevel command:

$ runlevel

N 3

 find out runlevel of  Linux system

 

 

show the static routing table in linux

Name

route - show / manipulate the IP routing table
Synopsis


 route [-CFvnee]
route
[-v] [-A family] add [-net|-host] target [netmask Nm] [gw Gw] [metric N] [mss M] [window W] [irtt I] [reject] [mod] [dyn] [reinstate] [[dev] If]
route
[-v] [-A family] del [-net|-host] target [gw Gw] [netmask Nm] [metric N] [[dev] If]
route
[-V] [--version] [-h] [--help]
Description

Route manipulates the kernel's IP routing tables. Its primary use is to set up static routes to specific hosts or networks...

 

how to view processes in linux

 

[root@]# ps aux | less
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   2064   620 ?        Ss   Oct18   0:04 init [3]                 
root         2  0.0  0.0      0     0 ?        S<   Oct18   0:00 [migration/0]
root         3  0.0  0.0      0     0 ?        SN   Oct18   0:00 [ksoftirqd/0]
root         4  0.0  0.0      0     0 ?        S<   Oct18   0:00 [watchdog/0]
root         5  0.0  0.0      0     0 ?        S<   Oct18   0:00 [migration/1]
root         6  0.0  0.0      0     0 ?        SN   Oct18   0:00 [ksoftirqd/1]
root         7  0.0  0.0      0     0 ?        S<   Oct18   0:00 [watchdog/1]
root         8  0.0  0.0      0     0 ?        S<   Oct18   0:00 [migration/2]
root         9  0.0  0.0      0     0 ?        SN   Oct18   0:00 [ksoftirqd/2]
root        10  0.0  0.0      0     0 ?        S<   Oct18   0:00 [watchdog/2]
root        11  0.0  0.0      0     0 ?        S<   Oct18   0:00 [migration/3]
root        12  0.0  0.0      0     0 ?        SN   Oct18   0:00 [ksoftirqd/3]
root        13  0.0  0.0      0     0 ?        S<   Oct18   0:00 [watchdog/3]

how to view processes in linux********* simple selection *********  ********* selection by list *********
-A all processes                      -C by command name
-N negate selection                   -G by real group ID (supports names)
-a all w/ tty except session leaders  -U by real user ID (supports names)
-d all except session leaders         -g by session OR by effective group name
-e all processes                      -p by process ID
T  all processes on this terminal     -s processes in the sessions given
a  all w/ tty, including other users  -t by tty
g  OBSOLETE -- DO NOT USE             -u by effective user ID (supports names)
r  only running processes             U  processes for specified users
x  processes w/o controlling ttys     t  by tty
*********** output format **********  *********** long options ***********
-o,o user-defined  -f full            --Group --User --pid --cols --ppid
-j,j job control   s  signal          --group --user --sid --rows --info
-O,O preloaded -o  v  virtual memory  --cumulative --format --deselect
-l,l long          u  user-oriented   --sort --tty --forest --version
-F   extra full    X  registers       --heading --no-heading --context
                    ********* misc options *********
-V,V  show version      L  list format codes  f  ASCII art forest
-m,m,-L,-T,H  threads   S  children in sum    -y change -l format
-M,Z  security data     c  true command name  -c scheduling class
-w,w  wide output       n  numeric WCHAN,UID  -H process hierarchy

#ps -ef

Task: Use ps command

Type the following ps command to display all running process
# ps aux | less

Where,

  • -A: select all processes
  • a: select all processes on a terminal, including those of other users
  • x: select processes without controlling ttys

Task: see every process on the system

# ps -A
# ps -e

Task: See every process except those running as root

# ps -U root -u root -N

Task: See process run by user vivek

# ps -u vivek

 

Tags:
 

how to configure apache in linux

If you configured the Apache HTTP Server with the HTTP Configuration Tool in previous versions of Red Hat Linux and then performed an upgrade, you can use the application to migrate the configuration file to the new format for version 2.0. Start the HTTP Configuration Tool, make any changes to the configuration, and save it. The configuration file saved will be compatible with version 2.0.



 

The HTTP Configuration Tool allows you to configure...

 

How to recover root password in linux

  It happens sometime that you can't remember root password. On Linux, recovering root password can be done by booting Linux under a specific mode: single user mode.

This tutorial will show how to boot Linux in single user mode when using GRUB and finally how to change root password.

During normal usage, a Linux OS runs under runlevels between 2 and 5 which corresponds to various multi-user modes. Booting Linux under runlevel 1 will allow one to enter into a specific mode, single user...

 

How to Change the Time Zone in Linux

  Step 1: Look in your directory under "/user/share/zoneinfo" and choose an available time zone. An example is "America/Los_Angeles." Step 2: Browse to your directory "/usr/share/zoneinfo/your/zone," where "your" is the country and "zone" is the city that is most appropriate for your time zone. Step 3: Replace "your/zone" with the time zone you chose in Step 1. An example is "/usr/share/zoneinfo/America/Los_Angeles." Step 4: Enter the symbolic link...

 

how to set linux timezone

 Change directory to /etc

# cd /etc

Create a symlink to file localtime:
# ln -sf /usr/share/zoneinfo/EST localtimeOR some distro use /usr/share/zoneinfo/dirname/zonefile format (Red hat and friends)
# ln -sf /usr/share/zoneinfo/EST localtimeOR if you want to set up it to IST (Asia/Calcutta):
# ln -sf /usr/share/zoneinfo/Asia/Calcutta localtimePlease mote that in above example you need to use directory structure i.e. if you want to set the timezone to Calcutta (India) which is located in...

 

http status code 302 Found

 302 Found

The requested resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field.

The temporary URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new...

 

how to Start and stop vsftpd

 The vsftpd RPM installs the /etc/rc.d/init.d/vsftpd script, which can be accessed using the /sbin/service command.

To start the server, as root type:

/sbin/service vsftpd start

To stop the server, as root type:

/sbin/service vsftpd stop

The restart option is a shorthand way of stopping and then starting vsftpd. This is the most efficient way to make...

 
Page 26 of 34

Category

Login Form