This post is for those novice users who used to write a lot of C programs under Windows environment (using Turbo C, Borland C, Visual C etc.) and wished to move to the GNU/LINUX world. Here is your very first simplest “Hello World” application under Linux.
First, open Terminal. In Ubuntu, press ALT+CTRL+T to open Terminal. Or in general, press ALT+F2 to run application launcher and enter terminal or gnome-terminal. You can also open Terminal using Menu (under Accessories or System Tools).
Edit your C source file using any text-editor. For the sake of simplicity, here we will use gedit to write our hello_world.c source file. Otherwise you can use vim, emacs as console-based text-editor or Kate (under KDE) as GUI-based text-editor.
Do not forget to save the file.
Now compile your hello_world.c source code. Here we have passed “-o hello_world” parameter to gcc. This is basically our suggested name to the executable. Otherwise, gcc will make the default executable as a.out.
Finally, run your executable as
And you will see HELLO_WORLD on the screen.
My favorite download manager is IDM. In Linux you cannot run IDM except through Wine or VM.
I prefer to use “axel” which is a multi-threaded downloader.
sudo apt-get install axel
Then use it as follows,
axel -n <no._of_segments_upto_256> <download_link>
axel -n 8 http://www.kernel.org/pub/linux/kernel/v2.6/linux-22.214.171.124.tar.bz2
Note: You can use “-a “ for alternate download-progress bar
Step 1: Go to the directory where the .bin file is, using cd command
Step 2: Make the file executable.
sudo chmod +x file_name.bin
Step 3: Install the file.
Here I want to share a basic concept regarding hard disk partitioning and its layout. A hard disk can have at most four partitions which we all refer as “Primary Partition”.
But in real we may have more than four partitions in our laptops or PCs. Then how is it possible? Here comes the concept of “Extended Partition”. You can make any one of the four partitions as an extended partition and then repartition it according to your needs. These partitions are which we refer as “Logical Partition”.
In Linux, hard disks are identified as
/dev/hda (where a stands for the 1st hard disk)
/dev/sda (in recent linux systems sda is used instead of hda)
Now, sda1, sda2, sda3, sda4 are reserved for four primary partitions and logical partitions start with sda5 onwards. According to above layout, partition numbering in Linux should be
Note that sda4 is not used as it is reserved.
If you are behind a proxy server to connect to the Internet, you have to configure your ubuntu box. In windows, you generally go to the “Control Panel” and then “Internet Options” and set the IP addresses there (or in IE, under Tools –> Internet Options). In ubuntu, you can also set the proxy addresses in Firefox ( under Edit -> Preferences ->Advanced ->Network-> Settings). But this will not set the proxy for the whole system; as a result you cannot use apt-get for package management.
So for system-wide configuration, under
System -> Preferences -> Network Proxy
select “manual proxy configuration” and enter the values there.
Finally, press “Apply System-Wide” button, it will ask for your password twice.
Step 1 : Install corkscrew
# yum install corkscrew
for ubuntu, $ sudo apt-get install corkscrew
Step 2 : Write a script named git-proxy.sh and add the following
exec corkscrew <name of proxy server> <port> $*
# #<name_of_proxy_server> is the ip address of the server
Step 3 : Make the script executable
# chmod +x git-proxy.sh
Step 4 : Set up the proxy command for GIT by setting the environment variable
# export GIT_PROXY_COMMAND=”/<path>/git-proxy.sh”
Now use the git commands,such as
git clone git://git.xilinx.com/linux-2.6-xlnx.git
It may be a situation where you have a PC with windows installed and lots of data on other partitions and you need to install ubuntu on it without loosing any data (i.e. you do not want to format any partition). Here is what you can do ……
- Boot using the ubuntu live-cd
- Use the option — ” Try ubuntu without installing “
- Your live-cd environment is now ready
- Run the application ” gparted “
- gparted is a fantastic partition editor. Here you can resize any existing partition to make some free space for installing ubuntu without loosing any data.
- Right click on the partition you wish to resize, select “Resize”. Resize it according to your needs and “Apply”
- That’s it. You now have free space where you can install ubuntu.
- Now start the installer by clicking the icon on the desktop.