Try the Most Addicted Game - Real Rocket Racing 3d Game

Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Thursday, December 1, 2011

Apt-Get Utility: Ubuntu's Advanced Packaging Tool (APT)


The apt-get command is a powerful command-line tool used to work with Ubuntu's Advanced Packaging Tool (APT) performing such functions as installation of new software packages,  upgrade of existing software packages,  and even upgrading the entire Ubuntu system.

Some examples of popular uses for the apt-get utility:

Install a Package: Installation of packages using the apt-get tool is quite simple. For example, to install the network scanner nmap, type the following:
sudo apt-get install nmap

Remove a Package: Removal of a package or packages is also a straightforward and simple process. To remove the nmap package installed in the previous example, type the following:
sudo apt-get remove nmap

Update the Package Index: The APT package index is essentially a database of available packages from the repositories defined in the /etc/apt/sources.list file. To update the local package index with the latest changes made in repositories, type the following:
sudo apt-get update

Upgrade Packages: Over time, updated versions of packages currently installed on your computer may become available from the package repositories (for example security updates). To upgrade your system, first update your package index as outlined above, and then type:
sudo apt-get upgrade

Thursday, November 10, 2011

Basic Linux Commands

Here some basic commands for linux which will help you .

For changing directory / to /etc
[root@pc1 /]# cd /etc

One step back /etc to /
[root@pc1 etc]# cd ..
Go to previous working directory
[root@pc1 /]# cd -

Go to current login user home directory
[root@pc1 etc]# cd ~

Show the contents of /etc in single color
[root@pc1 ~]# dir /etc

Show the contents of /etc in different colors with nature of contents
[root@pc1 ~]# Ls /etc

create a folder on root partition
[root@pc1 ~]# mkdir /disk

Create a folder in /disk
[root@pc1 ~]# mkdir /disk/dir

Create multiple folder in multiple directories with single command
[root@pc1 ~]# mkdir /etc/dir1 /var/dir2 /usr/dir3

Create multiple folder in same directory
[root@pc1 ~]# mkdir dir1 dir2 dir3

Copy a file in directory
[root@pc1 disk]# cp file dir

Copy a file from /disk/file and paste it in /disk/dir/
[root@pc1 disk]# cp /disk/file /disk/dir

Copy a directory with –r option
[root@pc1 disk]# cp -r dir dir2

Copy a file from /disk/file and paste it in /etc with myfile name
[root@pc1 disk]# cp /disk/file /etc/myfile

Remove a file
[root@pc1 disk]# rm file

Remove a file with forcefully option
[root@pc1 disk]# rm –f file

Remove a directory with out –r option and you face will an error
[root@pc1 disk]# rm dir

Remove a directory with –r option
[root@pc1 disk]# rm -r /disk

Remove a directory with forcefully option
[root@pc1 disk]# rm -rf dir

Move /etc/dir1 to /disk/ with different name
[root@pc1 disk]# mv /etc/dir1 /disk/mydir
Rename the folder name mydir to dir
[root@pc1 disk]# mv /disk/mydir /disk/dir

Rename the file name with myfile
[root@pc1 disk]# mv file myfile

Read a file page by page with less command
[root@pc1 disk]# less /etc/grub.conf

Read a file page by page with more command
[root@pc1 disk]# more /etc/qrub.conf

Read first ten lines of grub.conf
[root@pc1 disk]# head /etc/grub.conf

Read last ten lings of grub.conf
[root@pc1 disk]# tail /etc/grub.conf

Read first 12 lines with –n option
[root@pc1 disk]# head -n 12 /etc/grub.conf

Read last 11 lines with –n option
[root@pc1 disk]# tail -n 11 /etc/grub.conf

Copy the contents of /etc/grub.conf in /disk/file
[root@pc1 disk]# cat /etc/grub.conf > /disk/file

Append the contents /etc/mtab in /etc/file
[root@pc1 disk]# cat /etc/mtab >> /disk/file

Merging tow commands with pipe sign output of the first command is input of second command
[root@pc1 disk]# cat /etc/squid/squid.conf I more
Count the total lines of squid.conf
[root@pc1 disk]# cat /etc/squid/squid.conf I wc -L

Show only spool words in squid.conf
[root@pc1 disk]# cat /etc/squid/squid.conf I grep spool

Flush the contents of file
[root@pc1 disk]# cat /dev/null > /var/log/messages