Knowledge7

The Linux and Mobile Solution Provider

  • About
  • Training
  • Services
  • Clients
  • In the news
  • Blog
  • Contact Us
You are here: Home / Topic / Shell scripting

Shell scripting

This topic is part of our Linux Network Services and Security training

Even though Linux has a lot of commands, sometimes it is necessary to write simple (and some not so simple) scripts when we have to automate jobs.

The Bash shell is capable of running scripts and it also possible to write scripts in the various programming languages that exist in Linux (such as AWK, Python and Ruby).

The following scripts need to be written and tested:

  • booklist
    Manage a book database: print, insert, select, delete, update
  • compareperm
    Check whether two files have the same permissions
    Usage: compareperm file1 file2
  • findhardlinks
    Find links (not symbolic) to a given file
    Usage: findhardlinks file [directory]
  • largestfile
    prints the largest file in a directory
    Usage: largestfile directory
  • summarise
    prints number of normal files, directories and symbolic links
    summarise directory. Two versions of the script can be written: one that does three passes through the files and can be slow and a second version which only does one pass through the files and, consequently, is quicker.
  • anagrams
    finds and prints all the anagrams in /usr/share/dict/words. The technique used was described by Jon Bentley in his magnificent book, Programming Pearls.
This topic is part of our Linux Network Services and Security training

Our forthcoming training courses

  • No training courses are scheduled.

Leave a Reply

Your email address will not be published. Required fields are marked *

Looking for something?

Want to know more?

Get our newsletter

Discover the latest news, tips and tricks on Linux, the Web and Mobile technologies every week for FREE

This work is licensed by Knowledge7 under an Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license.