Category: Linux


Uptime command with awk

Pretty much trick to get nice output via awk utility. Here is what I did with uptime πŸ™‚

uptime | awk -F’,’ ‘{print “last 1min” $4 “\n” “last 5min load average:” $5 “\n” “last 15min load average:”$6}’

Output:

last 1min 0.00
last 5min load average: 0.00
last 15min load average:0.00

Try it out πŸ™‚

Try installing GCC library using zypper:

zypper install libgcc_s1-4.7.2_20130108-0.17.2.x86_64.rpm
zypper install libstdc++6-4.7.2_20130108-0.17.2.x86_64.rpm
rpm -qa |grep gcc (For querying, if installation is done)

 

Zypper is the native command-line interface of the ZYpp package manager for installing, removing, updating and querying software packages of local or remote (networked) media. Its graphical equivalent is the YaST package manager module. (From Wiki)

 

Try it out πŸ™‚

Passwordless Authentication:

Password Less Authentication using SSH:

1. PuttyGen: generate both public and private keys

2. Save the private key on your PC

3. Go to server, create .SSH directory

4. Under this create a file named authorized_keys

5. paste public key in here and save it

6. Go to your Superputty, Tools, putty config, in SSH Tab in left corner, then Auth… browse your Private key here.

You’re good to go πŸ™‚

Here we have very efficient way by which you can remove Linux Partition from your Dual Boot XP/Vista/7.

Follow the simple steps:

1. Download easyBCD

2. Install it

3. Open it

4. Go to BCD Deployment

5. Select the MBR of XP/Vista/7 you installed as Dual Boot

6. Click on Write MBR

7. Restart it, there won’t be any Grub Menu for choosing the OS.

8. Start the computer with the OS with XP/Vista/7

9. Right click on icon of My computer

10.Click on Manage

11.Go to Disk Management 12.Delete the Linux Partition and Merge it with the existed windows partition
Its Done.

Check Linux system information ?

Here we have several commands through which you can check several information about your Linux system.

Type follow commands in terminal.

1. cat /proc/cpuinfo

2. dmidecode | less

3. cat /proc/cpuinfo | grep processor | wc -l

4. ethtool -i eth0

zypper is a command line package manager, how it is used, what options are there with this package manager are given below :

zypper                 # to print the list of available global options and commands
zypper help search     # to print help for the search command
zypper lp              # to see what patch updates are needed
zypper patch           # to apply the needed patches
zypper se sqlite       # to search for sqlite
zypper rm sqlite2      # to remove sqlite2
zypper in sqlite3      # to install sqlite3
zypper in yast*        # to install all packages matching 'yast*'
zypper up              # to update all installed packages with newer versions, where possible

Hosts file is very important, it is well configured, if you’re up to changing something with this file then be careful. Well, itΒ  has different place in different Operating Systems.

 

Location of Hosts file:

1. Linux/Unix/Posix :Β /etc/hosts

2. Window XP/Vista/7/8 : %SystemRoot%\system32\drivers\etc\hosts

3. Novel Netware : SYS:etc\hosts

4. plan 9 : /lib/ndb/hosts

For this we need to know the proper definition of command and utility, definition clearly tells us the difference between them.

Definitions:

Utilities: utilities are programs, such as who and date, that we can run or execute.

Commands: A command is the name of a program and any arguments you specify to that program to cause its behavior to change.

When the login program executes a shell, that shell is uninitialized. When a shell is uninitialized, important parameters required by the shell to function correctly are not defined.
The shell undergoes a phase called initialization to set up these parameters. This is usually a two step process that involves the shell reading the following files:
lΒ  /etc/profile

2 .profile
The process is as follows:
1. The shell checks to see whether the file /etc/profile exists.
2. If it exists, the shell reads it. Otherwise, this file is skipped. No error message is displayed.
3. The shell checks to see whether the file .profile exists in your home directory. Your homedirectory is the directory that you start out in after you log in.
4. If it exists, the shell reads it; otherwise, the shell skips it. No error message is displayed.