Useful Linux command line tips
Understanding the different file types in Linux
Labels:
linux
Making programs and commands run on user login
This week while installing Oracle 11g on Oracle Linux Server, I needed to automatically start some programs when the user logins in.
Here is why. Oracle Linux boots, by default, into a command line terminal or console. But to use the Oracle 11g Database Control application, you'll need to start the GUI X window. The command to do that is $ startx
The other issue is, the GUI launches into a blank desktop, no applications center or start menu bar. To start any program you'll have to right click, launch the Terminal and start you program via the command line.
For me this is no issue, but the intended end user of this Oracle 11g aren't that Linux savvy. I wanted them to just start the system and the X window would start automatically once they login and the dbconsole would be started too and finally Firefox would launch and open http://localhost:1158/em automatically.
Well, it was easy to accomplish. All I did was to edit the ~/.bash_profile file. I added the following lines -
startx
emctl start dbconsole
firefox http://localhost:1158/em
And voila, that did it.
How to set system environments permanently for a user
I finally got Oracle 11g installed on Oracle Linux Server, it was no easy task. I had to edit so many kernel or system settings files.
To run Oracle, I had to set $ORACLE_UNQNAME to orcl each time I login to the Linux. And the command to start up the dbconsole, aarghh, it was a pain to type out - /u01/app/oracle/product/11.2.0/dbhome_1/bin/emctl start dbconsole
I'm yet to forget it.
Well, I decided to fix this once and for all. And all I did was to edit the ~/.bash_profile, added the following lines -
export ORACLE_UNQNAME=orcl
export PATH=$PATH:/u01/app/oracle/product/11.2.0/dbhome_1/bin
So now I no longer need to set the ORACLE_UNQNAME=orcl anymore as it is been done for me. And the long path to emctl command has been added permanently to the system PATH. All I now do is type
emctl start dbconsole
and voila, I'm done.
How to install the wireless driver for D-link RaLink 5360 dwa 525 on Ubuntu 12.10
Well, his PC has a D-link wireless card dwa 525 with RaLink chipset 5360 and to my surprise Ubuntu 12.10 doesn't have its driver preloaded. But Ubuntu 13.04 has. So in this post I will show you how I fixed the issue with special help from chili555 on this Ubuntu Forum Thread
I couldn't access the internet from the PC, so I had to download the driver from another PC connected to the internet.
Very useful Linux administration commands
- all running processes, with full details>
Learning Linux? Free online books and practical help tips
Yes, I am typing out this post from my Ubuntu Linux OS, and I also have OpenSUSE, Windows 7 RC & Windows 8 RC(no $ to buy commercial version) all running on the same laptop, my venerable SONY VAIO.
So how did I learn to use Linux?
It all started in 2008. I started from ground zero. I was at the peak of my IT certification frenzy and I heard of this Linux + certification, so I decided to attempt the certification. I had done Oracle 10g Certified Administration Associate (OCA 10g) and Cisco Certified Network Associate (CCNA).
I spoke with a senior colleague, and he was too busy to even hear me out. I proceeded to help myself, I downloaded Ubuntu 8.04 alternate CD (my greatest mistake in IT, so far) and ended up irreparably crashing my Windows. The problem was that I downloaded an alternate CD, fortunately Ubuntu no longer makes alternate CDs (I think). Alternate CD is purely a commandline based installation CD, and I knew nothing about Linux file structure - root folder, home folder, ext2 file system, swap space... I got stuck for what seemed like an eternity at specifying root file and choosing file system, it won't let me choose NTFS and I knew jack about the other options. Finally, after trying out so many combinations, it finally accepted one. I had installed my first Linux OS all by myself, without any help. I was extremely happy, even though my Windows was gone.
Ever since, I have grown in my understanding and use of Linux. I have installed Linux for over 20 people, installed nearly all the free distros and have been quadri/penta-booting OSs on my laptop since 2009. And I now train people on how to use Linux.
How did I achieve my expertise?
I read all I could on Linux. I kept practicing, sharing my knowledge and helping people solve their computer problems with my Linux knowledge. It got me the fix-it guy status among my friends.
Reading and practicing is the only way to learn Linux.
Where can you get good Linux books for free?
Linux prides itself as being free. And so many people have put up their Linux how-to books for free online. And a good starting point will be -
http://www.linux.org/tutorial/view/beginners-level-course
Introduction to Linux
http://tille.garrels.be/training/tldp/index.html
Linux Newbie Administration Guide
http://lnag.sourceforge.net/downloads/LinuxNewbieAdministratorGuide.pdf
Bash Guide for Beginners
http://tille.garrels.be/training/bash/
Ubuntu Pocket Guide & Reference
http://ubuntupocketguide.com/download_main.html
I assure you that reading this book and practicing on a real Linux system, you'll become a Linux guru too.
You too can write Unix/Linux scripts
Labels:
linux,
Safe Installation and Administration,
Tips
Are you new to the world of Unix/Linux and hitherto have been impressed by the flexibility of the operating system?
Have you been considering scripting as a very cryptic task reserved for those that earn a living making them?
Well, it's time you hear the truth! Linux scripting is extremely easy and you too can start exploiting the benefits they offer.
Without much ado, let's see an example of a script.
#!/bin/bash
echo "Hello World"
Vital Linux tips
That was about 3 years ago, though it's not a long time but in computer world it's like half a century. I, definately, have moved ahead and even installed Linux (several distros) over 30 times on over 10 laptops (most probably). So in this post I will share with your two vital Linux tips, or should I say keyboard shortcuts that I have been overusing.
TIP 1
Arguably the best feature of Linux (for enthusiasts) is that you can can install tens of full feature softwares on a disk space size Windows will use to install just one of those softwares. Take me for instance, my Fedora is installed on a 4GB partition (inclusive of swap space and Home) and yet I run out of space on my 50GB Windows XP partition nearly every month without ever running out of space on my Fedora (please, don't take this literally). In the end I get to have all the applications I want on my Linux, so it is often a task (medium size one) to search out the the application I want to run. This is where the Tip 1 comes to the rescue.
I just press the ALT and F2 key (on the keyboard) at the same time, then a small box come on screen and I type the name of the application I want to run. The best part of this is that it guesses the application as I provide the characters of the name, making it more than easy when I'm not sure of the application's name.
TIP 2
When we first get to know about Linux, we strongly believe it is all keyboard and blackscreen, no mouse pointer or GUI. Actually it used to be, and can still be (if you make it be). So the easiest (or cheapest) way to make it be is by installing a fancy GUI linux distro and booting into the dummy's galaxy of no more, then go further by using the key combination --
CTRL + ALT + F1
CTRL + ALT + F2
CTRL + ALT + F3
CTRL + ALT + F4
CTRL + ALT + F5
CTRL + ALT + F6
CTRL + ALT + F7
On some distros (like Fedora), the GUI is on F1 not F7.
Thanks for reading my blog, if you have any comment feel free to use the comment box. Have a great day.
How to share internet access on your android phone with other phones and computers via wireless connection (wifi)
Live Booting Linux from CD-ROM, DVD-ROM and USB Flash
Labels:
Fedora,
linux,
LiveUsb,
Safe Installation and Administration,
USB
Download or copy from someone who has, the Linux OS image (always in .iso format)
Step 2
If you do not have a software that can burn CD or DVD image, then download active@ ISO Burner, it is free. (Most CD burning utilities can burn images, I know of Nero and Roxio)
To make USB flash images, dowload liveusb-creator-3.7 free utility.
Step 3
Install these softwares and run them. The liveusb-creator-3.7 does not need installation, just extract the zip file and run the application
![]() |
| From Drop Box |
Step 4
Insert the empty CDor DVD into your drive and set the parameters on the active ISO burner to that shown below
But if your CD or DVD drive is not very strong, set the Speed to 10x for CD and 4x for DVD. In fact, those settings are recommended even if your drive is new. This prevents error in the data burned since you will end up burning till the edge of the CD or DVD considering the size of the images which nearly equals the total capacity of the CD or DVD.
Then browse to the directory of the Linux OS image file and select it in the source box below.
![]() |
| From Drop Box |
For the USB flash image,
click the browse button and select the image file. Indicate the Target Device and create live USB.
Step 5
Reboot your computer and set the boot sequence to use DVD/CD drive and USB drive before Hard Disk.
Voila! Your computer will boot into the Linux OS, just make sure you do not install the Linux yet, and choose 'Boot without installing' or 'Run without any changes to your computer'. Now you can tryout the Linux OS without installing it on your hard disk.
RSS Feed
Twitter














