Saturday 30 November 2013

Linux Terminal Crash Course

- 0 comments

The Linux (or any *nix) Terminal is one of the most powerful computing interfaces in the world. The possibilities of this very basic yet feature-rich interface are virtually endless. A Linux terminal has changed a lot since the days of pioneer computer users.


There are many not-so-well-known features of a linux terminal (I mean emulator terminal here not the plain one from old times). Several commands and keypresses can make your life really easy, especially if you are a sysadmin.

A good example of such a command is history. If you type history on terminal and press return, a list of commands you have run before opens. You can simply type a ! (exclamation mark) followed by the serial of the command you can see from the history that opened. This will run that command without you needing to type that all over again! Say for example there is a command perl -e 'print "hello world\n";' in the history and the serial # mentioned before it is 120. Then entering !120 on the terminal will run that command again. Sounds convenient?

Here's a list of several very useful Linux terminal shortcuts:

Virtual terminals
Ctrl + Alt + F1 - Switch to the first virtual terminal. In Linux, you can have several virtual terminals at the same time. The default is 6.
Ctrl + Alt + Fn - Switch to the nth virtual terminal. Because the number of virtual terminals is 6 by default, n = 1...6.
tty - Typing the tty command tells you what virtual terminal you're currently working in.
Ctrl + Alt + F7 - Switch to the GUI. If you have the X Window System running, it runs in the seventh virtual terminal by default in most Linux distros. If X isn't running, this terminal is empty.
Note: in some distros, X runs in a different virtual terminal by default. For example, in Puppy Linux, it's 3.

Command line - input
Home or Ctrl + a  -  Move the cursor to the beginning of the current line.
End or Ctrl + e -  Move the cursor to the end of the current line.
Alt + b - Move the cursor to the beginning of the current or previous word. Note that while this works in virtual terminals, it may not work in all graphical terminal emulators, because many graphical applications already use this as a menu shortcut by default.
Alt + f - Move the cursor to the end of the next word. Again, like with all shortcuts that use Alt as the modifier, this may not work in all graphical terminal emulators.
Tab  - Autocomplete commands and file names. Type the first letter(s) of a command, directory or file name, press Tab and the rest is completed automatically! If there are more commands starting with the same letters, the shell completes as much as it can and beeps. If you then press Tab again, it shows you all the alternatives. This shortcut is really helpful and saves a lot of typing! It even works at the lilo prompt and in some X applications.
Ctrl + u - Erase the current line.
Ctrl + k  - Delete the line from the position of the cursor to the end of the line.
Ctrl + w - Delete the word before the cursor .
Ctrl + t  -  Switch 2 characters on a command line. If you typed sl, put the cursor on the l and hit ctrl+t to get ls.
Ctrl + b  - Moves to the beginning of the previous or current word

Command line - output
Shift + PageUp - Scroll terminal output up.
Shift + PageDown - Scroll terminal output down.
clear - The clear command clears all previously executed commands and their output from the current terminal.
Ctrl + l - Does exactly the same as typing the clear command.
reset -  If you mess up your terminal, use the reset command. For example, if you try to cat a binary file, the terminal starts showing weird characters. Note that you may not be able to see the command when you're typing it .
Ctrl+S Ctrl+Q - terminal output lock and unlock. These are simple shortcuts to pause and continue terminal output, works in most terminals and screen multiplexers like screen. You can use it to catch something if things change too fast, and scroll with Shift + PgUp PgDown. On linux console ScrollLock can also be used.

Command line - history
history - When you type the history command, you'll see a list of the commands you executed previously.
ArrowUp or Ctrl + p - Scroll up in the history and edit the previously executed commands. To execute them, press Enter like you normally do.
ArrowDown or Ctrl + n - Scroll down in the history and edit the next commands.
Ctrl + r - Find the last command that contained the letters you're typing. For example, if you want to find out the last action you did to a file called "file42.txt", you'll press Ctrl + r and start typing the file name. Or, if you want to find out the last parameters you gave to the "cp" command, you'll press Ctrl + r and type in "cp".
Sudo !! - Run last command as root

Command line - misc
Ctrl + c - Kill the current process.
Ctrl + z - Send the current process to background. This is useful if you have a program running, and you need the terminal for awhile but don't want to exit the program completely. Then just send it to background with Ctrl+z, do whatever you want, and type the command fg to get the process back.
Ctrl + d - Log out from the current terminal. If you use this in a terminal emulator under X, this usually shuts down the terminal emulator after logging you out.
Ctrl + Alt + Del - Reboot the system. You can change this behavior by editing /etc/inittab if you want the system to shut down instead of rebooting.

Since, most (if not all) Linux distributions come with friendly GUI interfaces, there are lots of terminal emulators out there. Which one you use depends on your preference. Some of them are:

    Gnome Terminal Emulator
    Konsole
    Xterm
    Rxvt
    Yakuake

Though, for the sake of ease of use, today most people prefer working on GUI windows with fancy components like buttons and text-boxes, the good old terminal still haven't  lost its significance. In fact there are many tasks even today that cannot be done on a GUI properly; a terminal is inevitable for them.
Read More »

Friday 15 November 2013

Why Big Corporations Hate Free Software

- 0 comments
Free software is not a new term. When first programs were created they were free. But commercialism hits everything (that seems lucrative) eventually. If you create something you will definitely like to preserve its value. But its not fair when that "value" is mistakenly associated with "money". Software giants like Micro$oft always try to undermine free software initiatives.


Let us check out some points/scenarios to find out about why and how this happens!

Money flows in!
Capital is definitely the first reason. They are a software company whose obvious objective is financial profit --by hook or by crook. So the idea of free software is definitely disastrous to them. If people stop paying for software they would not exist anymore then.

We are greedy!
Greed is a universal trait not limited to time and place. It was there in dinosaurs... it is there in us too. Our greed is centered on money though. Big corporations take it to a new level by standardizing it. They train their employees to be voracious in terms of profit and do everything that's needful for that purpose. In terms of software industry that would mean making pacts with hardware vendors to create trouble for free software developers.

Let people remain dumb!
It is really easy to make dumb people pay for buggy software compared to their smarter counterparts. How to achieve that? Simple. Encapsulate the technology used behind a "user friendly" interface and spoon feeding the users about "where to click" so to say. If the users do not know (or don't care) about what the software does in the background they won't complain about their system being spied upon by the government, etc.

In simple words, they need minions and slaves --thanks to our stupid generation they are getting that easily. Seriously, I have heard people proudly saying "I don't know about computers anything more than using Facebook!"

Corporation for corporations!
A company strictly adhering to manuals full of policies and compliances would definitely prefer to install Internet Explorer over Mozilla Firefox. Why? In Internet Explorer you cannot install add-ons easily. In Firefox, you can customize. IE is essentially not free (it comes with Windows that you purchase). Firefox is free (both in terms of money and usage). Why take the risk of giving the employees freedom to install what they want when the company can impose its choice on them.

Illuminati.. !
Somebody's definitely laughing on the other end of this article. But mythical or not --the tyrannical point-of-view of freemason has nothing to do with the word "free" itself. Its rather laughable who gave this name - "free"-mason! However, even as ideology this (possibly) ruling dynasty of Devil worshippers also wants people to act as cattles. To mobilize billions of people with dynamic minds they first need to be fed with the notion and lifestyle of slaves. Since, we are using software on a daily basis now in our computers and phones, its a clever idea to mind control through software itself. And free software is obviously not going to be helpful in that.


Read More »
All Articles © Asit. No Copying. Powered by Blogger.
 
Copyright © . The Tech Veda - Posts · Comments
Markup Powered by Bluefish Editor 2.2