Friday, May 8, 2015

Linux Bash Shell Tutorial : How to use I/O redirection.5 tips and tricks


  Understanding Input Output or I/O redirection works in Linux helps us streamline our job better when working with the terminal. In this tutorial,I will share quick tips and tricks on how to use I/O redirection in our system.

A few terminology that will help you understand this tutorial is as below:



Standard Input -what is being type in terminal from keyboard.

Standard output -text that display in terminal on command execution
Standard  error – text that display in terminal when a command runs and exit with an error

Content List

1)Redirecting standard output to a file.
2)Redirecting a file to standard input.
3) Redirecting standard error to a file.
4)Redirecting Standard output and error to one file
5) Disposing unwanted output -/dev/null (bit bucket)


1)Redirecting standard output to a file.


Use “>” operator sign to redirect and save output file in current directory .




To append/update existing file use “>>”




2)Redirecting a file to standard input.

Use  “<” operator to redirect an input to the terminal


In above example, I write new content to file stdin and  redirect stdin file to the terminal  using "<" sign operator.

3) Redirecting standard error to a file.

Use “2>” operator sign to redirect standard error to a new file in current directory.


To append/update existing file use “2>>”



4)Redirecting Standard output and error to one file

Use “&>” operator sign to redirect standard output and standard error to a  new file in current directory .


To append/update existing file use “&>>”


file stdouterr
5) Disposing unwanted output -/dev/null (bit bucket)

Use “2> /dev/null” operator sign to redirect unwanted  output to bit bucket. Data  that are redirect to bit bucket will be deleted without a trace. As such some people also call bit bucket as a black hole.



*NOTE:If you execute the same command using  ">" ,"<" ,"2>" ,"&>"  to same file name but with different content, the file will be overwritten with new file content .

Thursday, May 7, 2015

Linux Bash Shell Tutorial : How to change user terminal password in Ubuntu using command line and GUI



 Changing terminal password is an important  part in managing a Linux system. There will be a time when you want to change terminal password to something more secure or reliable. This tutorial will  guide you on how to change user terminal password using either the terminal command or Ubuntu GUI.

1)Change password from the Terminal

1.1) Run in terminal "passwd" command
orca@Positive-Space:~$ passwd                                                                                                                                        


On running the command, you  will be prompted to enter your new password. Enter your new password to confirm. Your password will be updated  straight away .


2)Change password from Ubuntu GUI

2.1) Search user accounts from Ubuntu dash panel
 Search for User accounts setting panel .


2.2)Click  password panel to change the password.


2.3)Change your password and click "Change"



Logout from the system and  test your new password !! :-)

Tuesday, May 5, 2015

How to delete old kernels in Ubuntu using Ubuntu tweak GUI



  Kernel is an important part of Linux system. When you upgrade to new kernel version, the old kernel will be left in your system . As time goes by, this might consume your hard drive and cause  problem to your system.

  One of the examples that old kernel might do to your system is  the system unable to install update from Ubuntu Software updater. When you click "Install Now" button, an error will occur .

"The upgrade needs a total of 79.0M free space on disk '/boot'. Please free at least an additional 7,381k of disk space on '/boot' .Empty your trash and remove temporary packages of former installation using 'sudo apt-get clean' "



  One of the reasons why this problem happens is because the old kernel images are filling up your  /boot drive partition . 

  There are few ways on how to remove old kernel. In this tutorial, I share on how to remove old kernel file images using Ubuntu Tweak program.The guide below will help you to install and delete old kernels using the program

1) Download Ubuntu Tweak program


 1.1)Download Ubuntu Tweak from their website

Downloading Ubuntu Tweak


1.2)Double click the download file and finish the  installation from Ubuntu Software Centre.


Ubuntu Software Centre


2)Run Ubuntu Tweak and delete old kernels

2.1)Search Ubuntu Tweak from Ubuntu dash panel and run the program.



2.2)On the Top side panel click "Janitor" and tick  "Old kernel"  under System.




2.3)Check your latest kernel version from the terminal by typing

orca@Positive-Space:~$ uname -r                                                                          


2.4) Click the  old kernel  that you want to delete and click "clean"  to delete old kernels. It is a good practice to keep  previous latest old kernel version on your system .



Removing unwanted kernel

Remaining kernel


 3)Reboot your system try to update your system again . ;)