Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Download and install vmware tools in Ubuntu linux

A simple step by step tutorial to install VMware tools in Ubuntu linux server in command line. It works with all the version of Ubuntu servers including the Latest Ubuntu 14.10.
Follow the detailed guide here 

Install Java SE Development Kit(JDK) on CentOS6

FREQUENTLY ASKED QUESTIONS (Linux)
Q: How to install java SE Development Kit (JDK) on CentOS6 ?


Go to Oracle and download JDK for your 64bit or 32bit CentOS Linux
for 32bit CentOS: Download "Linux x86 - RPM Installer"
for 64bit CentOS: Download "Linux x64 - RPM Installer"

After downloading...
[root@server ~]# rpm -ivh jdk-7-linux-i586.rpm
OR
[root@server ~]# rpm -ivh jdk-7-linux-x64.rpm

Preparing...                ########################################### [100%]
   1:jdk                    ########################################### [100%]
Unpacking JAR files...
        rt.jar...
        jsse.jar...
        charsets.jar...
        tools.jar...
        localedata.jar...

Install Remote Desktop Client on CentOS6

FREQUENTLY ASKED QUESTIONS (Linux)
Q: How to install remote desktop CentOS?

Installing Windows RDP remote desktop client on CentOS Linux to connect to a Windows running machines with RDP protocol.
Applicable to : CentOS6, CentOS5, CentOS4, etc.
Install remote desktop client for CentOS from YUM repository
[root@server ~]# yum -y install rdesktop

After installing rdesktop on CentOS (run commands on X window)
Command usage:
# rdesktop [Options if any] <ipaddress>
Command example:
[root@server ~]# rdesktop 192.168.10.50
[root@server ~]# rdesktop -g 900x750 -u James 192.168.10.50

Connect RDP server with a different port number (eg: port 2500)
[root@server ~]# rdesktop -u James 192.168.10.50:2500

Available and usefull Options
-g  Desktop geometry (Window resolution)
-u  Username
-p  Password
-f  Full screen mode

Install VNC Viewer/Client on Fedora and CentOS Linux

FREQUENTLY ASKED QUESTIONS (Linux)
Q: How to install TigerVNC client or viewer on linux?

This post covers installing a VNC client or VNC viewer on your linux machine. You can install the VNC viewer packages from the yum repository on RPM based linux distributions. With this VNC client you can access to  Linux and Windows running VNC servers remotely. This is a cross platform application.
Applicable to: RHEL, Redhat, CentOS, Redhat, etc.

Install VNC viewer from YUM
(If your linux is not connected to internet directly, enable yum commands through a proxy server
[root@server ~]# yum -y install tigervnc

After installing Go to Applications=>Internet=>TigerVNC Viewer

Send Message to Another User Linux

FREQUENTLY ASKED QUESTIONS (Linux)
Q: How to send messages to terminal users on linux command line?

Use "write" command to send messages to Linux users who logged in using terminal. It will helpful if more users are logged in to a same Linux server via terminal and they all can communicate Linux users with text messages. You can send message to a Linux user in a special tty if one user is logged with more sessions.

Command usage:
# write <recipient's username>
or
# write <recipient's username> <tty name>
<type your message to the user>   and press enter

Example:
[root@server ~]# write admin
Hey Admin, How are you ?

Tip: press Ctrl+z to stop and exit

How the Recipient(admin) receives the message
[admin@server ~]# 

Message from root@server on pts/1 at 18:38 ...
Hey Admin, How are you?


Send message to a user in a different tty or pts
[root@server ~]# write admin pts/2
(message will send to admin logged in pts/2 only)
Tip: Use "w" command to identify the pts/tty of a logged in user

Where is Trash directory located on Linux

FREQUENTLY ASKED QUESTIONS (Linux)
Q: Where is Trash folder location or path in linux?

  You can find the Trash (Recycle Bin) directory under the ".local/share/Trash/" location. And there will be two directories named "info" and "files", where "info" includes a "filename.trashinfo" file that includes the original file location and deleted date and time of all trashed files. "files" directory includes the full and original deleted files.
You can read and modify the trashed items/files also. And you can empty trash or delete files from trash using normal "rm" command in command line.
Please Note: This Trash directory only created when you delete a file to trash folder first.

Accessing Trash Directory Command line
Applicable to: RHEL, Redhat, CentOS, Ubuntu, Debian, Fedora, etc. 
[root@server ~]# cd ~/.local/share/Trash/
[root@server Trash]# ls
files   info

[root@server Trash]# ls files/
video.avi
[root@server Trash]# ls info/
video.avi.trashinfo

[root@server Trash]# cat info/video.avi.trashinfo

[Trash Info]
Path=/home/admin/Videos/video.avi
DeletionDate=2012-09-10T13:58:13


Install Teamviewer 7 on Ubuntu 12.04 and Debian

FREQUENTLY ASKED QUESTIONS (Ubuntu)
Q. How to install Teamviewer 7 on Ubuntu 12.04 ?

Teamviewer is a free* and secure remote desktop sharing cross platform application. Teamviewer works with Mac OS, Linux, Windows, etc.
Get Teamviewer 7 for Ubuntu/Debian operating systems

Or download it from command line
user@ubuntu:~$ wget http://www.teamviewer.com/download/teamviewer_linux.deb
user@ubuntu:~$ wget http://www.teamviewer.com/download/teamviewer_linux_x64.deb

Install Teamviewer 7

user@ubuntu:~$ sudo dpkg -i teamviewer_linux.deb

user@ubuntu:~$ sudo dpkg -i teamviewer_linux_x64.deb

*Teamviewer is free for personnel use only.

Changing User ID and Group ID In Linux

FREQUENTLY ASKED QUESTIONS (Linux)
Q: How do i change the User IS and Group ID in Linux operating systems?

Every users and group has a unique ID (UID and GID) in linux operating system. You can change the default user ID of a user or a group ID of a group in Linux operating system. Use "usermod" and "groupmod" commands to modify the ID value of users/groups.

Changing user ID for the user account
# usermod -u <new user id> <username>
Example:
[root@server ~]# usermod -u 600 james

Changing the group ID of a group
# groupmod -g <new group id> <group name>
Example:
[root@server ~]# groupmod -g 700 accounts

Remove A User's Password in Linux

FREQUENTLY ASKED QUESTIONS (Linux)
Q: How to remove a user password in linux ?

Removing a user password of a user account in Linux operating systems like Redhat, CentOS, Fedora, Ubuntu, Debian, etc. After removing the password of a user account, that user cannot login to the system without a password.
Command Usage: (Redhat, CentOS, Redhat, Ubuntu)
# passwd -d <username>

Command Example:
[root@server ~]# passwd -d james

Print all File names in a folder to a text file (For Linux and Windows)

FREQUENTLY ASKED QUESTIONS (Linux)
Q. How can i print the file names of a folder into a text file.?
Q. How to print the dir/ls command output to a text file?

You can copy all file names in a folder/directory to a text file with the help of command prompt in windows and with command terminal in linux systems.
-->
After running the command, the output will write to a text file and save to current directory. The command is same for Linux and windows.

In Windows Operating systems(Windows 7,8, XP, Vista, 2008))
Open command prompt and run the below command
Command Usage:
C:\>dir <folder> >filename.txt
Example:
C:\>dir d:\Files\ >filename.txt

In Linux Operating systems(Redhat, CentOS, Fedora, Ubuntu, etc)
Open terminal and run the below command
Command Usage:
# ls > filename.txt
Example:
# ls /home/admin/ > contents.txt

Upgrading RPM Packages

FREQUENTLY ASKED QUESTIONS (Linux)
Q. How can i upgrade a installed .RPM package?

Upgrading an installed .RPM package (Rehat Packet Management) on a Linux server is a simple task with RPM commands. Here you already have installed some version of the a package and you need to upgrade it to a latest version and erase all previous versions if installed. You need to be root or a super user to install/upgrading any packages. These command will work on all RPM based linux distributions like Redhat Linux, CentOS, Fedora, etc.
-->
Command Usage:
# rpm -Uvh <package.rpm>
-U :   upgrading the installed RPM package to the new version.

Example:
[root@server ~]# rpm -Uvh package.rpm

Wget: Download Files In Command Line In Linux

Downloading files from internet in command line is possible with the "wget" command. You can download any file from web like softwares, rpm packages, music files, etc with its web url. Many linux operating systems have wget preinstalled with. wget can download files with http, https and ftp protocols.

Check if wget is preinstalled on your linux
[root@server ~]# rpm -q wget
wget-1.12-1.4.el6.x86_64

If not, Install wget from YUM repository
[root@server ~]# yum -y install wget

Download a file with wget from http
[root@server ~]# wget http://example.com/file.zip
Wget with Username and password (http)
[root@server ~]# wget --http-user=USER --http-password=PASS http://example.com/file.zip

Download a file with wget from https
[root@server ~]# wget https://example.com/file.zip

Download a file with wget from ftp
[root@server ~]# wget ftp://example.com/file.zip
Wget with Username and password (FTP)
[root@server ~]# wget --ftp-user=USER --ftp-password=PASS ftp://example.com/file.zip

Download multiple files with wget
[root@server ~]# wget http://example.com/file1.zip http://example.com/file2.zip

Sleep Command In Fedora CentOS And Redhat Linux

FREQUENTLY ASKED QUESTIONS (Linux)
Q: How to sleep my linux system?

You can use "sleep" command in Fedora, CentOS and Redhat Linux operating systems.
Command Usage: sleep [number] [Option]
If no options specified seconds is the default option.

Eg: Sleep for 22 seconds
[root@server ~]# sleep 22

Sleep for 22 minutes
[root@server ~]# sleep 22m

Sleep for 3days 22minutes and 5 seconds
[root@server ~]# sleep 3d 22m 5s

Available Options
s:     Seconds
m:    Minutes
h:     Hours
d:     Days

Schedule Restart/Reboot In Ubuntu Using Command

FREQUENTLY ASKED QUESTIONS (Linux)
Q: How to schedule a restart/Reboot in Ubuntu Linux?

You can schedule a restart in your Ubuntu Linux server with "shutdown" command with Reboot switch(-t) and time options. A command example to schedule a restart ubuntu server at 22:00 (Use 24hr time format).

user@ubuntu:~$ sudo shutdown -r 22:00

How to cancel a scheduled restart in Ubuntu
user@ubuntu:~$ sudo shutdown -c

Schedule a Shutdown In Ubuntu/Debian With command

FREQUENTLY ASKED QUESTIONS (Linux)
Q: How to Schedule s shutdown in Ubuntu/Debian linux?

You can schedule a shutdown in Ubuntu Linux using "shutdown" command with halt switch (-h) and time. Below is an example command to shutdown your Ubuntu Linux server at 14:30. (use 24hr time format)

user@ubuntu:~$ sudo shutdown -h 14:30

How to Cancel a already scheduled shutdown
user@ubuntu:~$ sudo shutdown -c

For Shutdown Ubuntu Instantly
user@ubuntu:~$ sudo poweroff
or
user@ubuntu:~$ sudo shutdown -h

Schedule Restart/Roboot in Redhat, CentOS, Fedora Linux

FREQUENTLY ASKED QUESTIONS (Linux)
Q: How to schedule a restart or reboot in Fedora/CentOS/Redhat linux?

You can schedule a restart or reboot with "shutdown" command with reboot option (-r). Here is the command to schedule a reboot at 16:50 (Always use 24hr time format) with a sample output of the command.

[root@server ~]# shutdown -r 16:50
Broadcast message from root@server
        (/dev/pts/0) at 16:30 ...

The system is going down for reboot in 20 minutes!

How to cancel a scheduled restart
[root@server ~]# shutdown -c

Schedule Shutdown In Fedora, Redhat, CentOS Linux

FREQUENTLY ASKED QUESTIONS (Linux)
Q: How to schedule a shutdown in CentOS, Redhat, Fedora linux?

      Scheduling a shutdown is a simple task in RPM based Linux distributions like Redhat, CentOS, Redhat, etc. You can schedule a shutdown with the help of "shutdown" command. with "Time" options.

Here is the command to schedule a shutdown at 22:40 (24hr format). The Linux server will do an automatic shutdown/halt at 22:40 with a sample output of the command.

[root@server ~]# shutdown -h 22:40

Broadcast message from root@server
        (/dev/pts/0) at 22:30 ...
The system is going down for halt in 10 minutes!



How to cancel a pending/Scheduled shutdown in Linux
[root@server ~]# shutdown -c

Find Processor and Memory Details on Linux

FREQUENTLY ASKED QUESTIONS (Linux)
Q: How to find processor and memory (RAM) information in linux systems?

Find Processor details
You can find the CPU information with the following commands. You can find CPU Architechure, number of CPUs, Clock speed, number of cores, L2 cache memory, Vendor, CPU family, flags, stepping, fpu, cpuid level, wp, TLB size, address sizes, power management, etc.

[root@server ~]# cat /proc/cpuinfo
and
[root@server ~]# lscpu

Find Memory (RAM) Details
Finding total memory, free and used memory, cached memory, inactive and active, swap space, Buffers, etc.
[root@server ~]# cat /proc/meminfo
and 
[root@server ~]# free

Starting a New VNC Session on Linux

FREQUENTLY ASKED QUESTIONS (VNC Server)
Q: How to start a new VNC session on Linux?

This article will talk about creating and managing VNC sessions in a Linux server. Hope you read my previous articles about installing and configuring VNC server and some troubleshooting tips for VNC.
Continue reading...

Create a new User account for VNC access (can also use existing ones)
[root@server ~]# useradd admin

Login as the New User and setup VNC password (for VNC access only)
[root@server ~]# su admin
[admin@server ~]# vncpasswd
Password:
Verify:

Start the VNC Session for the new user with any Display number (here i used :1)
[admin@server ~]# vncserver :1
xauth:  creating new authority file /home/admin/.Xauthority

New 'localhost.localdomain:1 (admin)' desktop is localhost.localdomain:1

Creating default startup script /home/admin/.vnc/xstartup
Starting applications specified in /home/admin/.vnc/xstartup
Log file is /home/admin/.vnc/localhost.localdomain:1.log

Now allow firewall (iptables) to allow port 5901/TCP to accept incoming VNC connections.
(Login as root first)
[root@server ~]# iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
[root@server ~]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]

Now access the VNC server








Killing a VNC session
To kill or stop a VNC session you need to login as the associated user first.
[admin@server ~]# vncserver -kill :1
Killing Xvnc process ID 2675

Linux Command to Convert man page to PDF and TXT Files

FREQUENTLY ASKED QUESTIONS (Linux)
Q. How do i convert Linux man pages to PDFs and text files?
Well.. Sometimes you need to convert and download the Linux man pages in different file formats like .pdf, .txt, etc. This article explains to convert the Linux man pages into PDF and Text files using built in commands and tools in Linux.

Convert and Download "yum" man page to .PDF file
[root@server ~]# man -t yum | ps2pdf - yum.pdf

Convert and Download  "yum" man page to .TXT file
[root@server ~]# man -t yum | ps2ascii - yum.txt

Tested in Fedora, Redhat and CentOS linux systems.

Related Posts Plugin for WordPress, Blogger...

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Coupons