Wednesday 23 July 2014

Change display resolution in Linux

Change display resolution in Linux

This also reflects upon the display size in vSphere client, which was the reason I needed to changed the resolution, it was a bit too big and had to scroll the screen and wanted to reduce its size.

To change the VGA card display resolution in RHEL5

1) First check all the possible resolutions supported by your graphics card using the following command.

            "xrandr"

It will display all possible resolutions.


2) Change resolution.

Suppose your graphics card support 1024x768 resolution then you can change it using the following command.

"xrandr -s 1024x768"



If you don't have "1024x768" in that “xrandr” output, try below one this might be help to get “1024x768”.


In “/etc/X11/xorg.conf” file just check the entries


            SubSection "Display"
                        Viewport  0 0
                        Depth     24
                        Modes "1024x768"
            EndSubSection


Check the entry “Modes”. If it is not present just add this line and check.

Thursday 10 July 2014

Close port on Linux

sudo netstat -lpn | grep 8080
will list the process on port 8080
example:
tcp      0     0   :::8080      :::*      LISTEN   21026/java

kill 21026

Friday 4 July 2014

Copy a file

cp file file.bak
cp file /home/user/file.bak

Copy "file" and give the copy a name "file.back". Optionally place the copied file to another location by specifying a path.