1. Avoid out of the session or close the terminal with the command Ctrl+D
set -o ignoreeof Enable Ctrl+D
set +o ignoreeof Disable Ctrl+D
2. The Alias — We introduce a command with an alias, and the shell will recode it with its value. For example, whether we define an alias this way: alias buscar=”find. -name”, when we input commands in the line buscar name_file the shell will execute find. -name name_file and will seek the file we ask starting in the current path.
Alias name_of_the_alias="command_which_will_execute_the_alias".
unalias To disable an alias use the command unalias: name_of_de_alias. If you want to see the alias defined in the system just write: alias.
3. Most recently used commands — Execute the following instruction in the console:
history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -rn|head -10
The history command shows a list of all recently executed commands. You can use the arrow keys to navigate the next and previous commands.
4. Kill all the process in a determined application — This command will be very useful when you are running programs which tend to drag on the system resources. Open terminal and type: ps aux c. The first column It will show you a complete list of running processes. contain the user owner of the process, the second one is the PID of the process and if we jump to the last column we will see the name of the application which belong to each processes. If the application you want to kill is, for example, Firefox, then it would be: ps aux c | grep firefox and then write kill -9. The next time you do a ps aux c | grep firefox, this program shouldn’t appear anymore.
5. Get the basic system information — There are some commands you can use to determine basic information of your machine such as kernel version, hardware information and others. The following command lines shows what they’ll return when executed;
$ cat /proc/version = "It returns a full string of information"
$ uname -m = "The result of the machine's number"
$ uname -r = "Show the version of the kernel"
$ uname -n = "Returns the local domain name"
$ uname -s = "Will show the system name"
$ uname -p = "It tells you the type and name of the processor"
$ uname -a = "Will show all the information above and also the date and time of the system"
6. Use the Calendar — With the following commands you can have different views and displays of the Calendar in the different versions of Linux.
cal -3 = "Simply display the calendar"
cal 1 2008 = "This command display a calendar of a particular month of the year"
date -d fri = "Display the date of the next on the current or next week"
date --date='25 Dec' +%A = "Tell you which day will be Christmas this year"
7. Disk Space — Having sufficient and optimized disc space is something vital for good performance of your system. In the case of Linux, here are the different ways to optimize your storage space and display information of your hard disc.
df -h = "This command display the free disc space"
fdisk -l = "Very similar to Windows environment show you the partitions of the disc"
ls -lSr = "Display the all the files and the biggest last"
du -s * | sort -k1,1rn | head = "Show top disc users in the current directory"
8. Set Operations — In Linux you can make operations with files quickly. Test the following commands which help you a lot to manipulate files.
LANG=C sort file1 file2 | uniq" = "Make the union of unsorted files"
LANG=C sort file1 file2 | uniq -d = "Intercept unsorted files"
LANG=C comm file1 file2 | sed 's/^\t*//' = "Union of sorted files"
LANG=C comm -3 file1 file2 | sed 's/^\t*// = "Symmetric difference of sorted files"
9. Text Manipulation — Manipulation of text is another very important aspect of the work. Let’s see some of this in Linux.
sed -n 's/.*
sed -n '10,20p;20q' = "Print lines from 10 to 20"
sed ':a; /\\$/N; s/\\\n//; ta' = "Concatenate lines between \"
sed 's/[ \t]*$//' = "Remove trailing spaces from lines"
sed 's/string1/string2/g' = "Replace string1 with string2"
10. Searching of Files — Faster method to search for almost anything under a Linux platform.
alias l='ls -l --color=auto'page" = "Make a quick listing of directories"
ls -lrt = "List files by date"
find -name '*.[ch]' | xargs grep -E 'expr' "Search 'expr' in the current directory and below"
find -type f ! -perm -444 = "Find files not readable by all"
locate -r 'file[^/]*\.txt' = "Search cached index for names"
11. Frozen Windows — Sometimes you can have a frozen window, and there are two fast ways to solve this problem without turning off your computer or restarting it. First, you can try the traditional key combination of Ctrl + Alt + Backspace.
The other way is a little more complicated than the previous one but is more efficient. Hit Ctrl + Alt + F2 to jump to the virtual console. Then log in with your user name, password and type the following:
ps -ax | grep startx
This executed command will provide you the PID of your Xserver. Then kill it with the next command
kill -9 PID_Number
If you want return to your first console, just press Alt + F1.
12. Remote Execution — With the service “rexec” you can have remote execution, very useful when you are working on a network environment. The user using this service must authenticate with a user name and password.
Installation Instructions for installing Java
Install
# Linux self extracting binary file
# Linux RPM package
To install the Linux (self-extracting) file
1. At the terminal: Type:
su
2. Enter the root password.
3. Change to the directory in which you want to install. Type:
cd
For example, to install the software in the /usr/java/ directory, Type:
cd /usr/java/
Note about root access: To install the JRE in a system-wide location such as /usr/local, you must login as the root user to gain the necessary permissions. If you do not have root access, install the JRE in your home directory or a subdirectory for which you have write permissions.
4. Change the permission of the file you downloaded to be executable. Type:
chmod a+x jre-1_5_0-linux-i586.bin
5. Verify that you have permission to execute the file. Type:
ls -l
Make sure the installation file has executable permission
6. Start the installation process.Type:
./jre-1_5_0-linux-i586.bin
This displays a binary license agreement. Read through the agreement. Press the spacebar to display the next page. At the end, enter yes to proceed with the installation.
type YES to agree to the license agreement
7. The JRE is installed into its own directory. In this example, it is installed in the /usr/java/jre1.5.0 directory. When the installation has completed, you will see the word Done.
The installation completes
8. The JRE is installed in jre1.5.(version number) sub-directory under the current directory. In this case, the JRE is installed in the /usr/java/jre1.5.0 directory. Verify that the jre1.5.0 sub-directory is listed under the current directory. Type:
ls
Verify the installation filename
The installation is now complete. Skip to the Enable and Configure section.
1. Go to the plugins sub-directory under the Mozilla installation directory
cd
2. In the current directory, create a symbolic link to the JRE ns7/libjavaplugin_oji.so file Type:
ln -s
Example:
* If Mozilla is installed in this directory:
/usr/lib/mozilla-1.4/
* and if the JRE is installed at this directory:
/usr/java/jre1.5.0
* Then type at the terminal to go to the browser plug-in directory:
cd /usr/lib/mozilla-1.4/plugins
* Enter the following command to create a symbolic link to the Java Plug-in for the Mozilla browser.
ln -s /usr/java/jre1.5.0/plugin/i386/ns7
/libjavaplugin_oji.so .
3. Start Mozilla browser or restart it if it is already running. Note that if you have other Mozilla components (ie: Messenger, Composer, etc) running, you will need to restart them as well.
4. Go to Edit > Preferences. Under Advanced category > Select Enable Java
Mozilla 1.2, Netscape 6 and later
1. Go to the plugins sub-directory under the Netscape directory
cd
2. Create a symbolic link to the ns7-gcc29/libjavaplugin_oji.so file:
ln -s
Example:
* If Netscape is installed at this directory:
/usr/lib/Mozilla1.2/
* And if the JRE is installed at this directory:
/usr/java/jre1.5.0
* Then type at the terminal to go to the browser plug-in directory:
cd /usr/lib/Mozilla1.2/plugins
* Enter the following command to create a symbolic link to the Java Plug-in for the Mozilla browser.
ln -s /usr/java/jre1.5.0/plugin/i386/ns7-gcc29
/libjavaplugin_oji.so .
3. Start Mozilla browser or restart it if it is already running. Note that if you have other Mozilla components (ie: Messenger, Composer, etc) running, you will need to restart them as well.
4. Go to Edit > Preferences. Under Advanced category > Select Enable Java