<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3667008750322446441</id><updated>2025-04-30T05:15:45.820-07:00</updated><category term="Linux Shell Scripting"/><category term="Windows Tips and Tricks"/><category term="Mobile Reviews"/><category term="General Knowledge"/><category term="Mobile phone news"/><category term="history of commands"/><category term="Latest technology"/><category term="New Technologies"/><category term="sed"/><category term="Arithmetic calculations"/><category term="Ask a question"/><category term="Find command"/><category term="For Linux Newbies"/><category term="Health"/><category term="Hot News"/><category term="Islam"/><category term="Solaris"/><category term="date"/><category term="food"/><category term="size"/><category term="sort"/><title type='text'>Shell Programming</title><subtitle type='html'>This is a site which contains information, programming and how to&#39;s about Linux/Unix Bash Shell scripting and Windows tricks and tips.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>105</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-1402365787474980978</id><published>2012-10-31T08:57:00.000-07:00</published><updated>2012-10-31T08:57:10.340-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><category scheme="http://www.blogger.com/atom/ns#" term="sed"/><title type='text'>Linux Bash Scripting: How to combine two lines by removing newline character using sed</title><summary type="text">


 

In this post we will see how to remove the newline character and combine two lines in a text file using &quot;sed&quot;.



In sed, we have single line version and multi-line version of few commands. One such command is the next command. Click here to see an example for single-line version of next command in sed. 



You might want to look at :

How to remove a blank line after a particular line </summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/1402365787474980978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-combine-two.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/1402365787474980978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/1402365787474980978'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-combine-two.html' title='Linux Bash Scripting: How to combine two lines by removing newline character using sed'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0nyJgOPQwR-UEjvWw61P0WDNX-e-m2FxwIg4qfkdwAM6ExgHJLvs00rtwuxIclS7wBZfKYVowkoe-3FzjtDtMRaWsmUHl2RtuSXPuMAJya9fAO5QAa9AvSwuRCifPKHycL3lu9RJaSc/s72-c/terminal.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-1455480904572827915</id><published>2012-10-30T09:59:00.001-07:00</published><updated>2012-10-30T09:59:39.978-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="date"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>Linux Bash Scripting: How to create directories for each day of the current month</title><summary type="text">


 

&amp;nbsp;In this post I have written a script that creates an empty directory for each day of the current month. I used cal command to get the date and month instead of using date command. The reason is that the date command does not work in Solaris. To make it portable, I have used cal command.

The below script does the following

It takes the total number of days of the current month&amp;nbsp;
</summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/1455480904572827915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-create.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/1455480904572827915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/1455480904572827915'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-create.html' title='Linux Bash Scripting: How to create directories for each day of the current month'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0nyJgOPQwR-UEjvWw61P0WDNX-e-m2FxwIg4qfkdwAM6ExgHJLvs00rtwuxIclS7wBZfKYVowkoe-3FzjtDtMRaWsmUHl2RtuSXPuMAJya9fAO5QAa9AvSwuRCifPKHycL3lu9RJaSc/s72-c/terminal.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-6723913621544005350</id><published>2012-10-28T07:35:00.002-07:00</published><updated>2012-10-28T08:08:19.105-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><category scheme="http://www.blogger.com/atom/ns#" term="sed"/><title type='text'>Linux Bash Scripting: How to remove a blank line after a particular line using sed</title><summary type="text">


 
Removing a blank line after a particular line can be achieved using the single-line next command (n) of the sed editor.



The lowercase n command tells the sed editor to move to the next line of text in the data stream, without going back to the beginning of the sed commands. Normally the sed editor processes all of the defined commands on a line before moving to the next line of text in </summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/6723913621544005350/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-remove.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/6723913621544005350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/6723913621544005350'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-remove.html' title='Linux Bash Scripting: How to remove a blank line after a particular line using sed'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0nyJgOPQwR-UEjvWw61P0WDNX-e-m2FxwIg4qfkdwAM6ExgHJLvs00rtwuxIclS7wBZfKYVowkoe-3FzjtDtMRaWsmUHl2RtuSXPuMAJya9fAO5QAa9AvSwuRCifPKHycL3lu9RJaSc/s72-c/terminal.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-3882327755064094604</id><published>2012-10-23T11:29:00.000-07:00</published><updated>2012-10-23T11:29:18.120-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ask a question"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>Linux Bash Scripting: How to modify the ls command output using pr command</title><summary type="text">



I have received the below question in our &quot;Ask a question&quot; section of this blog.



Q: Using set -A write a script to print the output of the ls command in 5 
columns with two spaces between each column. Pretend that ls does not 
have multi column output.



Normally we will get a multi column output if we use the command ls -A as shown below.



   
/home/sittik/programs $ ls -A
arr.sh  </summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/3882327755064094604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-modify-ls.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/3882327755064094604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/3882327755064094604'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-modify-ls.html' title='Linux Bash Scripting: How to modify the ls command output using pr command'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhINc_JM2Lb6aeogj3Ait_-EYP1PtokbNTBCewV-hugtSvXE04TpIhWvw_TVumE1u8FG73FkmRGw5yBt5-5JaO8JbzWakjMmQGpyFTS73Laf25svutXnwlz4YO77XN_944nj_CqUhvP_lY/s72-c/Linux+_shell_scripting_questions_doubts.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-2003689219989576526</id><published>2012-10-21T08:52:00.002-07:00</published><updated>2012-10-21T08:54:19.267-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="For Linux Newbies"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>Linux Bash Scripting: Standard file descriptors STDIN, STDOUT and STDERR and input/ouput redirection</title><summary type="text">


&amp;nbsp;

Linux system handles every object as a file. This includes input and output processes also. The linux identifies each file using a file descriptor. 

What is a file descriptor?
A file descriptor is a non negative integer which uniquely identifies the open files. Each process can have upto 9 open files at a time. The bash shell reserved three file descriptors(0, 1 and 2) for special </summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/2003689219989576526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-standard-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/2003689219989576526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/2003689219989576526'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-standard-file.html' title='Linux Bash Scripting: Standard file descriptors STDIN, STDOUT and STDERR and input/ouput redirection'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0nyJgOPQwR-UEjvWw61P0WDNX-e-m2FxwIg4qfkdwAM6ExgHJLvs00rtwuxIclS7wBZfKYVowkoe-3FzjtDtMRaWsmUHl2RtuSXPuMAJya9fAO5QAa9AvSwuRCifPKHycL3lu9RJaSc/s72-c/terminal.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-861452094954331556</id><published>2012-10-17T19:46:00.000-07:00</published><updated>2012-10-17T19:46:14.475-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Find command"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>Linux Bash Scripting: how to rename or delete a file which has special characters in its filename</title><summary type="text">




Suppose if you have created a file with a special character in its name because of a typo, you may not be able to access it. You may not even be able to delete the file. For example, see the below files.

   
$ touch &quot;test-file1 &quot;
[Note: There is a space at the end]

$ touch &quot;test&#39;file2&quot;
[Note: There is a single quote in the middle]

$ touch &quot;test?file3&quot;
[Note: There is a question mark in </summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/861452094954331556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-rename-or.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/861452094954331556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/861452094954331556'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-rename-or.html' title='Linux Bash Scripting: how to rename or delete a file which has special characters in its filename'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0nyJgOPQwR-UEjvWw61P0WDNX-e-m2FxwIg4qfkdwAM6ExgHJLvs00rtwuxIclS7wBZfKYVowkoe-3FzjtDtMRaWsmUHl2RtuSXPuMAJya9fAO5QAa9AvSwuRCifPKHycL3lu9RJaSc/s72-c/terminal.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-409436855293620890</id><published>2012-10-15T03:07:00.001-07:00</published><updated>2012-10-15T03:07:41.918-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arithmetic calculations"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>Linux Bash Scripting: Perform floating point calculation/arithmetic/operation using BC</title><summary type="text">


&amp;nbsp;

As we have discussed on performing Arithmetic operations on our previous post, now we will look at the floating point operations in the shell script in this post.

You might want to look at :&amp;nbsp;
Perform Arithmetic operations or mathematical calculations in Shell scripting - expr command

A huge limitation in the Bash shell is that it supports only integer arithmetic. There are </summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/409436855293620890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-perform-floating.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/409436855293620890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/409436855293620890'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-perform-floating.html' title='Linux Bash Scripting: Perform floating point calculation/arithmetic/operation using BC'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0nyJgOPQwR-UEjvWw61P0WDNX-e-m2FxwIg4qfkdwAM6ExgHJLvs00rtwuxIclS7wBZfKYVowkoe-3FzjtDtMRaWsmUHl2RtuSXPuMAJya9fAO5QAa9AvSwuRCifPKHycL3lu9RJaSc/s72-c/terminal.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-2135301555204286126</id><published>2012-10-14T19:39:00.000-07:00</published><updated>2012-10-14T19:39:25.045-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="history of commands"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>Linux Bash Scripting: How to ignore specific commands from being stored in the history in Linux</title><summary type="text">


 

If you see the history of your commands using the &quot;history&quot; command, you can see all the commands that you executed in the command line. If you don&#39;t want certain basic commands to be stored in your history, you can ignore them using HISTIGNORE. You can specify all the commands that you want to ignore in the HISTIGNORE.&amp;nbsp;

In the below code, I have ignored the commands pwd, ls, ls -ltr </summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/2135301555204286126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-ignore.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/2135301555204286126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/2135301555204286126'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-ignore.html' title='Linux Bash Scripting: How to ignore specific commands from being stored in the history in Linux'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0nyJgOPQwR-UEjvWw61P0WDNX-e-m2FxwIg4qfkdwAM6ExgHJLvs00rtwuxIclS7wBZfKYVowkoe-3FzjtDtMRaWsmUHl2RtuSXPuMAJya9fAO5QAa9AvSwuRCifPKHycL3lu9RJaSc/s72-c/terminal.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-7182966090933695519</id><published>2012-10-14T11:32:00.000-07:00</published><updated>2012-10-14T11:33:09.352-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="history of commands"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>Linux bash scripting: How to repeat the previous command quickly in the Linux command line</title><summary type="text">



There are four different ways by which we can repeat the previous commands that we executed in the command line.

1) use the &quot;UP arrow&quot; to view the previous command and press Enter to execute it.
2) Type !! and press enter from the command line
3) Type !-1 and press enter from the command line.
4) Press Control+P to display the previous commands. You can keep pressing the Ctrl+P to older </summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/7182966090933695519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linuz-bash-scripting-how-to-repeat.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/7182966090933695519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/7182966090933695519'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linuz-bash-scripting-how-to-repeat.html' title='Linux bash scripting: How to repeat the previous command quickly in the Linux command line'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGHFdOkylUnkXk0esOCKxaqvT7NtCYvvlSSAU8OrvHr8Phd8r8ZfB6aqIrgLa54KHJp9F9L0FXyJa2phL_q6byBFID4BXWQvlb08MRnqbPqit0jcZWbbWTV_tS8_2WKuV45s3YVxJVZ-U/s72-c/Terminal-icon-shell-linux-unix.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-1417656924087254462</id><published>2012-10-13T10:47:00.000-07:00</published><updated>2012-10-13T10:47:22.289-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="history of commands"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>Linux bash scripting: How to search the command history (previously executed commands)</title><summary type="text">


 

We often need to type long commands in the command line which we typed earlier. Instead of typing it again we can search the command history for the command we executed and execute it again. This technique will come handy when you are required to type a long command that you executed previously.

To search the command history and execute the command without editing it, Press Ctrl+R and type</summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/1417656924087254462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-search.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/1417656924087254462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/1417656924087254462'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-search.html' title='Linux bash scripting: How to search the command history (previously executed commands)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0nyJgOPQwR-UEjvWw61P0WDNX-e-m2FxwIg4qfkdwAM6ExgHJLvs00rtwuxIclS7wBZfKYVowkoe-3FzjtDtMRaWsmUHl2RtuSXPuMAJya9fAO5QAa9AvSwuRCifPKHycL3lu9RJaSc/s72-c/terminal.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-6055324971578690882</id><published>2012-10-13T10:35:00.000-07:00</published><updated>2012-10-13T10:35:45.115-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="history of commands"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>linux Bash Scripting: how to display the history of commands along with the timestamp</title><summary type="text">


 

Usually the history command will display the command number and the command when you execute the command from the command line. Suppose if you want to add the timestamp along with the command history for auditing purpose, you can do it using the HISTTIMEFORMAT as shown below.

     
$ export HISTTIMEFORMAT=&#39;%F %T &#39;
$ history | less 
   1  2012-10-11 04:12:36 vi .profile
   2  2012-10-11 04:</summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/6055324971578690882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-display.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/6055324971578690882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/6055324971578690882'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-display.html' title='linux Bash Scripting: how to display the history of commands along with the timestamp'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0nyJgOPQwR-UEjvWw61P0WDNX-e-m2FxwIg4qfkdwAM6ExgHJLvs00rtwuxIclS7wBZfKYVowkoe-3FzjtDtMRaWsmUHl2RtuSXPuMAJya9fAO5QAa9AvSwuRCifPKHycL3lu9RJaSc/s72-c/terminal.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-5175476579175746526</id><published>2012-10-12T10:39:00.001-07:00</published><updated>2012-10-12T10:39:47.612-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>Linux Bash Scripting: How to rename multiple files in a single go</title><summary type="text">




You might come across a situation where you need to rename lot of files with similar file names either by editing the file name or by truncating the last part of the file name. There are two ways by which you can accomplish the task. 

Method 1:

You can use the &quot;rename&quot; command to rename multiple files in a single go.

Syntax:

rename from to file...

- from is the word that you want to </summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/5175476579175746526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-rename.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/5175476579175746526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/5175476579175746526'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-rename.html' title='Linux Bash Scripting: How to rename multiple files in a single go'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0nyJgOPQwR-UEjvWw61P0WDNX-e-m2FxwIg4qfkdwAM6ExgHJLvs00rtwuxIclS7wBZfKYVowkoe-3FzjtDtMRaWsmUHl2RtuSXPuMAJya9fAO5QAa9AvSwuRCifPKHycL3lu9RJaSc/s72-c/terminal.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-6385448530989757024</id><published>2012-10-12T10:16:00.000-07:00</published><updated>2012-10-12T10:30:29.833-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Windows Tips and Tricks"/><title type='text'>Windows tips and Tricks</title><summary type="text">


 

I have personally tried and tested most of the tweaks discussed in this guide. However, I request fellow readers to be cautious while trying it out with your system. Always take a backup copy of all important data/registry before attempting to change the system/registry settings. Remember, prevention is always better than cure.



{&quot;pipe_id&quot;:&quot;1a6640e2a78b2c6e736f2220529daae5&quot;,&quot;_btype&quot;:&quot;list</summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/6385448530989757024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/windows-tips-and-tricks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/6385448530989757024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/6385448530989757024'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/windows-tips-and-tricks.html' title='Windows tips and Tricks'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHiPBaAgxYPO8J4vmLm9hQ2CalNxRj9MX7kreP7-BnffLkTpCusHaUHdVPtmVfFVP-kOxZQ5fun-ZmVGF-vsZAK3bXpAAke6ZH5rvaKZm8_l9dW3fkrZicHyBIROztafvNGvbZaEUQ6kM/s72-c/Windows.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-2939017917520757292</id><published>2012-10-11T11:12:00.000-07:00</published><updated>2012-10-12T11:06:16.512-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>Linux Bash Scripting: how to print a big chess board anywhere on the screen</title><summary type="text">











In this post, we will see how to create a big chess board that can be displayed anywhere on the screen rather than being displayed left aligned. Below is the script which displays the Chess board on the screen.

       
#!/bin/bash
# SCRIPT  : bigchess.sh
# PURPOSE : Prints big chess board on the screen using Linux style for loop.

clear                           # clears the screen
</summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/2939017917520757292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-print-big.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/2939017917520757292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/2939017917520757292'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-bash-scripting-how-to-print-big.html' title='Linux Bash Scripting: how to print a big chess board anywhere on the screen'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBabmbECiUnduCeD66bmnWBBEMcms6TO42k4wBQ8mjo44kb6_8UuVDcfahShQuIPtG1p84QnSIiar13SOze7-GEtJXPaiq9zIcOG7JHjKxDiv5wZJEks1IwlgybRoNCirZG63ErCMa1TA/s72-c/Chess_Board.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-8011449298099937508</id><published>2012-10-05T08:34:00.001-07:00</published><updated>2012-10-05T08:34:20.598-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>Have questions?? Need Clarifications??? </title><summary type="text">



Hi All,

I know that lot of us would get stuck while doing programming in Shell scripting or doing something in Linux. If you are badly in help and need to find an answer, you can make use of this page. Please post your questions on shell scripting in the comments box along with your email. Your questions will be answered and will be sent to your email. Please make use of this free service :)</summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/8011449298099937508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/have-questions-need-clarifications.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/8011449298099937508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/8011449298099937508'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/have-questions-need-clarifications.html' title='Have questions?? Need Clarifications??? '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhINc_JM2Lb6aeogj3Ait_-EYP1PtokbNTBCewV-hugtSvXE04TpIhWvw_TVumE1u8FG73FkmRGw5yBt5-5JaO8JbzWakjMmQGpyFTS73Laf25svutXnwlz4YO77XN_944nj_CqUhvP_lY/s72-c/Linux+_shell_scripting_questions_doubts.png" height="72" width="72"/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-4793594091426024893</id><published>2012-10-04T09:13:00.000-07:00</published><updated>2012-10-04T09:13:34.736-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><category scheme="http://www.blogger.com/atom/ns#" term="Solaris"/><title type='text'>how to change the default size of the terminal window in Solaris</title><summary type="text">



To change the default size of the terminal window in Solaris, you need to do the following.

1) Go to the directory /usr/share/vte/termcap/ and edit the file xterm

&amp;nbsp; &amp;nbsp;&amp;nbsp; i.e., $ vi /usr/share/vte/termcap/xterm 

2) Look for :co#115:it#8:li#36:\

3) In the above line you can change the numbers like for example, put 77 after &quot;co#&quot; and put 48 after &quot;li#&quot;

4) Then every terminal </summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/4793594091426024893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/how-to-change-default-size-of-terminal.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/4793594091426024893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/4793594091426024893'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/how-to-change-default-size-of-terminal.html' title='how to change the default size of the terminal window in Solaris'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioV2z2VOz9YUZQ4h3WjAvoZTqch7BMCj_9eUkN64hHlJ768vasTCvKI6fw2MQCf6RcaGxdOq6tm8et8cRDBQnuuCf2SD2bth7reylNA96mho-YRMVu16m5qr2d7AnJrf-QFBKzw0utyIg/s72-c/sol10logo.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-4605187598086899184</id><published>2012-10-02T09:21:00.000-07:00</published><updated>2012-10-02T09:21:01.463-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>Linux Shell Scripting: how to list the files alone in a directory </title><summary type="text">


 

&amp;nbsp;Often we tend to look into the directories to check what files are present in the directory. When we try to list the files using ls command, all files along with the directories will be displayed. What if we want to list only the files and not the directories???

We will see how to do that in this post.

1) Using &quot;find&quot; command:

$ find . -type f -maxdepth 1

The above command will </summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/4605187598086899184/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-shell-scripting-how-to-list-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/4605187598086899184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/4605187598086899184'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linux-shell-scripting-how-to-list-files.html' title='Linux Shell Scripting: how to list the files alone in a directory '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0nyJgOPQwR-UEjvWw61P0WDNX-e-m2FxwIg4qfkdwAM6ExgHJLvs00rtwuxIclS7wBZfKYVowkoe-3FzjtDtMRaWsmUHl2RtuSXPuMAJya9fAO5QAa9AvSwuRCifPKHycL3lu9RJaSc/s72-c/terminal.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-470330807195902208</id><published>2012-10-01T09:54:00.004-07:00</published><updated>2012-10-02T07:05:33.228-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>Perform Arithmetic operations or mathematical calculations in Shell scripting - expr command</title><summary type="text">


&amp;nbsp;

&amp;nbsp;The command which is used to perform mathematical or Arithmetic calculations is &quot;expr&quot; command.

Syntax: 
expr &amp;lt;operand 1&amp;gt; operator &amp;lt;operand 2&amp;gt;



Examples:
$ expr 2 + 3
$ expr 5 - 3
$ expr 7 % 3 
$ expr 12 \* 3
$ expr 12 / 6

However, even though the operations looks easy for performing, the &quot;expr&quot; command has a drawback. It uses special character (*) for </summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/470330807195902208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/arithmetic-operations-or-mathematical.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/470330807195902208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/470330807195902208'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/arithmetic-operations-or-mathematical.html' title='Perform Arithmetic operations or mathematical calculations in Shell scripting - expr command'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0nyJgOPQwR-UEjvWw61P0WDNX-e-m2FxwIg4qfkdwAM6ExgHJLvs00rtwuxIclS7wBZfKYVowkoe-3FzjtDtMRaWsmUHl2RtuSXPuMAJya9fAO5QAa9AvSwuRCifPKHycL3lu9RJaSc/s72-c/terminal.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-4598893424773803251</id><published>2012-10-01T08:32:00.002-07:00</published><updated>2012-10-02T07:01:42.312-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>How to print the last field in a file in Linux/Unix Shell scripting</title><summary type="text">





Let us see how to print the last field alone from a file which contains several fields. 

Let&#39;s say that the input is the below file.



$ cat priority.txt
Bash:P:Sun:7
NW:F:Mon:4
DB:P:Tue:8
SE:P:Fri:8



Now we need to Print the last field. i.e.

The required Output would be:
----------------------------------
7
4
8
8

We can do this by three ways. 

1) The normal awk way of doing it:

$ </summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/4598893424773803251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/3-ways-of-printing-last-field-in-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/4598893424773803251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/4598893424773803251'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/3-ways-of-printing-last-field-in-file.html' title='How to print the last field in a file in Linux/Unix Shell scripting'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0nyJgOPQwR-UEjvWw61P0WDNX-e-m2FxwIg4qfkdwAM6ExgHJLvs00rtwuxIclS7wBZfKYVowkoe-3FzjtDtMRaWsmUHl2RtuSXPuMAJya9fAO5QAa9AvSwuRCifPKHycL3lu9RJaSc/s72-c/terminal.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-421247183675767003</id><published>2012-10-01T07:21:00.001-07:00</published><updated>2012-10-01T08:50:53.533-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>How to find the latest file in a directory</title><summary type="text">




Suppose if you hava a directory with a huge set of files(more than 500) in a log directory, you would want to find the latest file in the directory. Now we can see few ways to that. 

for example, Let us take the below scenario

   $ ls -lrt
    total 476744
    -rw-r--r-- 1 sittik sdefault 13764 Aug 20 06:34 cache_log.23219.txt
    -rw-r--r-- 1 sittik sdefault 95451 Aug 20 06:38 cache_log.</summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/421247183675767003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/how-to-find-latest-file-in-directory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/421247183675767003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/421247183675767003'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/how-to-find-latest-file-in-directory.html' title='How to find the latest file in a directory'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0nyJgOPQwR-UEjvWw61P0WDNX-e-m2FxwIg4qfkdwAM6ExgHJLvs00rtwuxIclS7wBZfKYVowkoe-3FzjtDtMRaWsmUHl2RtuSXPuMAJya9fAO5QAa9AvSwuRCifPKHycL3lu9RJaSc/s72-c/terminal.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-3130976040736451749</id><published>2012-10-01T02:11:00.000-07:00</published><updated>2012-10-01T02:11:24.025-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>Linux/Unix Shell Scripting topics explained on requests</title><summary type="text">



Are you new to Shell scripting?&amp;nbsp; 
Are you learning Shell Scripting either in Linux or Unix?
Is it tough for you to understand?&amp;nbsp;
Do you feel confused while trying to learn a topic?
Is there anything in shell scripting that you are not able to understand?


Please let us know (leave your comments below). We are here to help you understand(Don&#39;t worry!!! We won&#39;t charge u for it :P). </summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/3130976040736451749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linuxunix-shell-scripting-topics.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/3130976040736451749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/3130976040736451749'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/10/linuxunix-shell-scripting-topics.html' title='Linux/Unix Shell Scripting topics explained on requests'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheTavSiAbviyk-FDGtuIjdgsKpkEhpw3NQRMAYzIk9K7BEBwFyZ-tqewx44VwMmxBdrbqXvMweSltl_03kLKrMLx-MPPmxlJ8XdxKvSg6Bm3DEi5-3LtubmEPCdTh-2e6HQ24xuem7Qo8/s72-c/shell_Scripting.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-7305018251739713901</id><published>2012-09-30T03:48:00.001-07:00</published><updated>2012-09-30T06:05:50.471-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>Linux terminal freezing problem [resolved] :-)</title><summary type="text">



 



I often wonder why my Linux terminal freezes when I press certain key combinations unknowingly. Finally when I found the key combination, I found that I pressed Ctrl+s key. Which is used for enabling the scroll lock. Hence the screen was shocked. To release the lock, we have to press the Ctrl+q. This key combination will unlock the scroll lock.

Please share any such instances with us </summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/7305018251739713901/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/09/linux-terminal-freezing-problem-resolved.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/7305018251739713901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/7305018251739713901'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/09/linux-terminal-freezing-problem-resolved.html' title='Linux terminal freezing problem [resolved] :-)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0nyJgOPQwR-UEjvWw61P0WDNX-e-m2FxwIg4qfkdwAM6ExgHJLvs00rtwuxIclS7wBZfKYVowkoe-3FzjtDtMRaWsmUHl2RtuSXPuMAJya9fAO5QAa9AvSwuRCifPKHycL3lu9RJaSc/s72-c/terminal.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-4439512857040311256</id><published>2012-09-30T03:42:00.002-07:00</published><updated>2012-09-30T03:42:44.015-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>How to display the text in Bold and Underline in Linux</title><summary type="text">


&amp;nbsp;


&amp;nbsp;To display the test in &quot;BOLD&quot; and &quot;UNDERLINE&quot;, the following ANSI Escape Sequences can be used. To display the text in BOLD$ echo -e &quot;\033[1mThis is a BOLD line\033[0m&quot;This is a BOLD line#Using tput$ tput bold$ echo &quot;This&quot; &amp;nbsp;&amp;nbsp;&amp;nbsp; #BOLD$ tput sgr0 &amp;nbsp;&amp;nbsp;&amp;nbsp; #Reset text attributes to normal without clear.$ echo &quot;This&quot; &amp;nbsp;&amp;nbsp;&amp;nbsp; #NORMALTo display the </summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/4439512857040311256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/09/how-to-display-text-in-bold-and.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/4439512857040311256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/4439512857040311256'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/09/how-to-display-text-in-bold-and.html' title='How to display the text in Bold and Underline in Linux'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0nyJgOPQwR-UEjvWw61P0WDNX-e-m2FxwIg4qfkdwAM6ExgHJLvs00rtwuxIclS7wBZfKYVowkoe-3FzjtDtMRaWsmUHl2RtuSXPuMAJya9fAO5QAa9AvSwuRCifPKHycL3lu9RJaSc/s72-c/terminal.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-4181636331159390245</id><published>2012-09-29T23:25:00.002-07:00</published><updated>2012-09-29T23:25:51.827-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><category scheme="http://www.blogger.com/atom/ns#" term="size"/><category scheme="http://www.blogger.com/atom/ns#" term="sort"/><title type='text'>How to sort the files and directories based on their size</title><summary type="text">





Let us see how to sort the files and directories. In my current directory, I have the following files and sub-directories:$ file *config: directoryval.dat: ASCII textsample.txt: ASCII textlog: directoryi.e., 2 files and 2 directoriesNow to list the files and directories (in the current directory) in the descending order of file size.$ du -sk * | sort -nr4730 log2779 config1100 val.dat968 </summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/4181636331159390245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/09/how-to-sort-files-and-directories-based.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/4181636331159390245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/4181636331159390245'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/09/how-to-sort-files-and-directories-based.html' title='How to sort the files and directories based on their size'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0nyJgOPQwR-UEjvWw61P0WDNX-e-m2FxwIg4qfkdwAM6ExgHJLvs00rtwuxIclS7wBZfKYVowkoe-3FzjtDtMRaWsmUHl2RtuSXPuMAJya9fAO5QAa9AvSwuRCifPKHycL3lu9RJaSc/s72-c/terminal.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3667008750322446441.post-7038380548324311026</id><published>2012-09-29T22:37:00.000-07:00</published><updated>2012-09-29T22:37:30.516-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux Shell Scripting"/><title type='text'>How to list the empty directories in Linux </title><summary type="text">


&amp;nbsp;

The find command in Linux has an option called &#39;empty&#39;. This option can be used to list empty regular files or empty directories. e.g.To list all the empty directories$ find . -type d -emptyOutput:./dir1/praset./salo/new/data5./premoc/test1
</summary><link rel='replies' type='application/atom+xml' href='http://waytobliss.blogspot.com/feeds/7038380548324311026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://waytobliss.blogspot.com/2012/09/how-to-list-empty-directories-in-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/7038380548324311026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3667008750322446441/posts/default/7038380548324311026'/><link rel='alternate' type='text/html' href='http://waytobliss.blogspot.com/2012/09/how-to-list-empty-directories-in-linux.html' title='How to list the empty directories in Linux '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00959857219901224053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0nyJgOPQwR-UEjvWw61P0WDNX-e-m2FxwIg4qfkdwAM6ExgHJLvs00rtwuxIclS7wBZfKYVowkoe-3FzjtDtMRaWsmUHl2RtuSXPuMAJya9fAO5QAa9AvSwuRCifPKHycL3lu9RJaSc/s72-c/terminal.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>