Saturday, 18 April 2020

Sysvale and LPI: Strategic planning in times of COVID-19

COVID-19, LPI Study Materials, LPI Tutorial and Material, LPI Certification, LPI Prep

When 2019 was just about to end, I got a message from Eugênio Marques, CEO of Sysvale Softgroup, a healthtech that has been collaborating with the Linux Professional Institute (LPI) since its foundation a little more than five years ago. Eugênio asked me to recommend someone who could host their strategic planning sessions and he also invited me to participate in these sessions as they wanted to formalize their Hiring Partner and devise specific actions in this regard.

It's worth noticing even before LPI had the Hiring Partner Program, Sysvale did create their own “Sysvale Certificada” program, promoting certifications among its collaborators and also opening it to the surrounding community, partnering with two major universities in the region, FACAPE and UNIVASF. The company is also well known for its award winning Free Technology Residence program, inspired by the health related residences where soon to be graduating students have the opportunity to learn by doing -- and being paid for this -- for a period varying from six to eighteen months before they are really ready to face the ICT market. Pretty much all of these students end up being hired by Sysvale or creating their own companies.

With the energetic help of Maria Gabriela Gomes Ferreira, the majority of Sysvale Team and myself, representing LPI, we started the strategic planning sessions on January, 6th, 2020. The sessions ended with a public presentation at the event “Sysvale Convida II”, on January 10th, where I talked about ICT careers (There are no quick tricks in the Magic World of ICT was the name of my talk) and Gabriela talked about her ten years journey helping companies to better prepare for their future.

By the end of February, 2020, the planning sessions continued on, now with Luiza Janeri, Agile Coach and OKR Specialist. Again, Luiza provided a talk to the extended community on how to use OKR (Objective and Key Results) metrics to better your personal life.

Then came the Coronavirus …

Being an Agile development company, Sysvale soon launched a solution to help all cities in Brazil to map the status of COVID-19 reach. The Northeastern based health tech assemble a team of developers, administrators, health professionals and public administrators from within and outside of the company to create a tool to provide clear information on the outbreak to the general public and, at the same time, gather individual, voluntary information about their health conditions, allowing health related public servers to take direct action in a very early stage.

COVID-19, LPI Study Materials, LPI Tutorial and Material, LPI Certification, LPI Prep
"The lack of information to the regular citizen is one of the greatest problems we are facing this moment and this is exactly where we have targeted our solution.", says Eugenio Marques, Sysvale's CEO. The solution, LigaSaudável, is totally based on Open Source Software and it is free for every citizen to use. Although it is targeted to Brazilian people and the reality Brazil is facing right now, the solution can readily be used by any Portuguese speaking region and can be easily ported to other languages.

Among several actions planned for 2020 are two open LPI certification events to be produced in partnership with the local academia, a “MeetUp” style, free Linux Essentials Training and the polishing of Sysvale’s DevOps Hello World workshop.

By better preparing its own team and also the surrounding community by using LPI’s certifications, Sysvale will place its feet on the international market in 2020, first within Portuguese speaking areas of the world such as Portugal, Mozambique, East Timor, Macao, Angola and Goa.

Source: lpi.org

Thursday, 16 April 2020

Linux Professional Institute DevOps Tools Engineer

DevOps Tools Engineer, LPI Study Materials, LPI Cert Exam, LPI Certifications

Businesses across the globe are increasingly implementing DevOps practices to optimize daily systems administration and software development tasks. As a result, businesses across industries are hiring IT professionals that can effectively apply DevOps to reduce delivery time and improve quality in the development of new software products.

To meet this growing need for qualified professionals, LPI developed the Linux Professional Institute DevOps Tools Engineer certification which verifies the skills needed to use the tools that enhance collaboration in workflows throughout system administration and software development.

In developing the Linux Professional Institute DevOps Tools Engineer certification, LPI reviewed the DevOps tools landscape and defined a set of essential skills when applying DevOps. As such, the certification exam focuses on the practical skills required to work successfully in a DevOps environment – focusing on the skills needed to use the most prominent DevOps tools. The result is a certification that covers the intersection between development and operations, making it relevant for all IT professionals working in the field of DevOps.

DevOps Tools Engineer, LPI Study Materials, LPI Cert Exam, LPI Certifications
Current Version: 1.0 (Exam code 701-100)

Objectives: 701-100

Prerequisites: There are no prerequisites for this certification.

Requirements: Pass the Linux Professional Institute DevOps Tools Engineer exam. The 90-minute exam consists of 60 multiple choice and fill-in-the-blank questions.

Validity Period: 5 years

Cost: Click here for exam pricing in your country.

Languages: English, Japanese

To receive the Linux Professional Institute DevOps Tools Engineer Certification the candidate must:

◉ Have a working knowledge of DevOps-related domains such as Software Engineering and Architecture, Container and Machine Deployment, Configuration Management and Monitoring.

◉ Have proficiency in prominent free and open source utilities such as Docker, Vagrant, Ansible, Puppet, Git, and Jenkins.

Also Read: LPI Certifications

Tuesday, 14 April 2020

Best Linux Certifications: RHCE, LPI, CompTIA, Linux Foundation, Oracle - 2020

Linux certifications are highly recommended by many companies as Linux gaining recognition by global platforms these days. These certification programs are gaining popularity among data administrators, system admins, DevOps engineers. It helps IT, professionals, to get knowledge and recognition.

Why Linux Certification?


◈ Most of the hiring manager are looking to recruit Linux professionals.

◈ The emergence of open cloud platforms is creating increasing demand for Linux professionals who have the right expertise

◈ Linux-certified professionals always be a better position in the job market

◈ Employers are looking for more Linux talent.

◈ Better salary increments for Linux certified professionals

Which Linux certification to choose?


There are multiple well-elaborated Linux certification courses available to those professionals who want to recognize and work as a Linux certificate get professional.

Some of the best certification course are given in this article are:

◈ Red Hat Linux SuSE Linux

◈ Linux Professional Institute (LPIC)

◈ CompTIA

◈ Linux Foundation

◈ Oracle

RHCE- Red Hat Certified Engineer


RHCE, LPI, CompTIA, Linux Foundation, Oracle, LPI Study Materials, LPI Tutorials and Materials, LPI Guides

Red Hat Enterprise Linux (RHEL) is a Linux distribution system which is developed by Red Hat. This certification program is targeted toward the commercial market.

Red Hat System Administration certification Study Material are designed for IT professionals who don't have previous Linux system administration experience.

Certification Name Red Hat Certified System Administrator (RHCSA)
Red Hat Certified Architect (RHCA)
Red Hat Certified Engineer (RHCE) 
Prerequisites & Required Courses  Basic technical user skills with handling computer applications and knowledge of some operating systems are expected. 
Exam Duration  5 hours. 
Career Path 
  • Linux system administrators
  • DevOps engineers
  • Cloud administrators 
Cost Per Exam  $400 each ($2,000 total RHCA exam costs) 

Oracle Linux Certification

RHCE, LPI, CompTIA, Linux Foundation, Oracle, LPI Study Materials, LPI Tutorials and Materials, LPI Guides

The Oracle Linux 6 Certified Implementation Specialist Certification course available for those who design, configure and implement Linux 6 solutions.

However, any applicant can complete this certification. It is mostly achieved by Oracle partner implementation professional who has hands-on experience in Linux and previous experience of implementing Linux 6.

Certification Name Oracle Linux 5 and 6 System Administration 
Prerequiesties & Requires Courses  No prerequisites 
Number of Questions  80
Duration  150 minutes 
Format  Multiple questions 
Passing Score   61%
Career Path   Oracle Linux System Administrator 
Cost per Exam   ₹10,475.00 
Validity  5 years 
Recommended Practice 1Z0-100: Oracle Linux 5 and 6 System Administration

LPI Certification Programs


RHCE, LPI, CompTIA, Linux Foundation, Oracle, LPI Study Materials, LPI Tutorials and Materials, LPI Guides

Linux Professional Institute (LPI) found in October 1999. After ten years later and after Linus Torvalds began his pioneering efforts on the Linux kernel. It helps software professionals to enhance their Linux knowledge.

Certification Name LPIC-1: Linux Administrator
LPIC-2: Linux Engineer
LPIC-3: Linux Enterprise Professional
Prerequiesties & Requires Courses 
  • LPIC-1: Fundamental Linux knowledge is required
  • LPIC-2: Candidate must have an active LPIC-1 certification
  • LPIC-3: Active LPIC-2 certification plus completion is one of the 300 series specialty exams
Format Online
Languages English, German, Japanese, Portuguese, Chinese
Passing Criteria Passing exams 101 and 102
Career Path Linux Certified Professional
Cost Per Exam $200
Validity  5 years 
All Practice Exam LPI Certification

CompTIA


RHCE, LPI, CompTIA, Linux Foundation, Oracle, LPI Study Materials, LPI Tutorials and Materials, LPI Guides

CompTIA Linux+ is a Linux certification course that tests the important usage and managerial activities which are common to all Linux distributors.

To get Linux+ certification, you have to clear these two online tests, which are CompTIA Linux Certification LX0-103 and LX0-104. The course content is very similar to the LPIC-1.

Certification Name
CompTIA Linux
Number of Exams
Two exams: LX0-103 and LX0-104
Prerequisites & Required Courses
(LX0-103) - None required
(LX0-104)- Recommended: CompTIA A+ CompTIA Network+ and 1 year of Linux administration experience
Format
Online
Number of Questions
60
Type of Questions
Multiple Choice
Duration
90 minutes
Languages
English, German, Portuguese, Spanish
Passing Criteria
500 (on a scale of 200 to 800)
Career Path 
Network Field Technician
  • Network Support Specialist
  • Network Administrator
  • Network Analyst
  • Technical Support
Cost Per Exam 
LX0-103 -$438 total ($219 per exam)
Validity 
3 Years
Practice Exam

Linux Foundation



The Linux Foundation Certified System Administrator (LFCS) certification. This certification is best suited for those candidates who want to become Linux system admin pursue their career as a Linux administrator.

The exam has a practical course design which allows a candidate to simulate on-the-job tasks and scenarios faced by a professional system administrator. Obtaining this Linux certification course helps them to check their skills.

Certification Name
Linux Foundation Certified System Administrator
Prerequisites & Required Courses
No prerequisites
Duration
2 hours
Exam Format
Online
Languages
English, Spanish, Portuguese, Japanese and German
Passing Score
  • LFCS Exam, a score of 66% or above needed
  • LFCE Exam, a score of 57% or above needed
Career Path
Linux Foundation Certified Engineer
Cost per Exam
$300
Validity
3 Years

Gcux: Giac Certified Unix Security Administrator


The main motive of attaining this certification program is to train professionals for installing, configuring, and monitoring Unix and Linux operating systems. You can get exam dumps online to practice.

Certification Name
GIAC Certification
Prerequisites & Required Courses
None required
Duration
2 hours
Number of Questions
75
Exam Format
Online
Passing Score
68%
Career Path
Not found
Cost Per Exam
$1,899
Validity
Not found

Advantages of Linux Certifications


Here is a prime pros/benefits of using Linux Certification
  • Joining Linux Certification program allows you to access to the official training material that helps you to prepare for the exam.
  • Offers you a chance to work on real-time projects and demonstrate learning hands-on.
  • Helps you to gain concise knowledge of concepts and its applications.
  • Support and guidance from industry experts and certified trainers all over the world
  • Hands-on Practice and lab sessions which help you clear your concepts in the area of application.

Saturday, 11 April 2020

fmt command in Linux with examples

fmt command in LINUX actually works as a formatter for simplifying and optimizing text files. Formatting of text files can also be done manually, but it can be really time consuming when it comes to large text files, this is where fmt comes to rescue.

fmt Command, Linux Tutorial and Material, Linux Learning, Linux Certification, LPI Prep

fmt re formats each paragraph in the file specified, writing to standard output. Here’s the syntax of fmt command:

// syntax of fmt command
$fmt [-WIDTH] [OPTION]... [FILE]...

where, the -WIDTH is an abbreviated firm of –width=DIGITS and OPTION refers to the options compatible with the fmt command and FILE refers to the file name.

If no FILE is specified, or if FILE is a dash(“-“), fmt reads from the standard input.

Using fmt command


fmt by default with no option used format all the words present in the given file in a single line.

$ cat kt.txt
hello
everyone.
Have
a
nice
day.

/* fmt by default puts all words
   in a single line and prints on
   stdout. */
$fmt kt.txt
hello everyone. Have a nice day.

To save or write the formatted output you can use fmt as :

/* Here the formatted output gets
   written in dv.txt */
$fmt kt.txt > dv.txt


Options for fmt command


-w, – -width=WIDTH option : By default, the maximum width is 75 that fmt command produces in output but with the help of -w option it can be changed, it just requires a numerical value for the width you want to specify.

$cat kt.txt
hello everyone. Have a nice day.

/* the width gets reduced to 10
   with -e option */
$fmt -w 10 kt.txt
hello ever
yone. Have
a nice day.

-t, – -tagged-paragraph option : There can be a need for highlighting the very first line in a text file which can be done by making the indentation of first line different from the other lines which can be done with -t command.

$cat kt.txt
hello everyone. Have a nice
and prosperous day.

/*-t makes the indentation
   of first line different
   from others */
$fmt -t kt.txt
hello everyone. Have a nice
   and prosperous day.

-s option : This option split long lines, but don’t refill them.

$cat kt.txt
Love is patient, love is kind. It does not envy,
it does not boast, it is not proud. It is not rude,
it is not self-seeking, it is not easily angered,
it keeps no record of wrongs. Love does not delight
in evil but rejoices with the truth. It always protects,
always trusts, always hopes, always perseveres.
Love never fails.

/* long lines get splited with -s option */
$fmt -s kt.txt
Love is patient, love is kind.
It does not envy, it does not boast, it is not proud.
It is not rude, it is not self-seeking,
it is not easily angered, it keeps no record of wrongs.
Love does not delight in evil but rejoices with the truth.
It always protects, always trusts, always hopes, always perseveres.
Love never fails.

-u, – -uniform-spacing option : This option uses one space between words and two spaces after sentences for formatting.

$cat kt.txt
Love   is   patient,   love is   kind.
    It does   not envy, it   does not boast,
 it is not   proud.

/* Spaces are uniformed with -u option */
$fmt -u kt.txt
Love is patient, love is kind.  It does not envy,
it does not boast, it is not proud.

-c, – -crown-margin option : This option preserves the indentation of the first two lines.
-p, – -prefix=STRING option : This option takes a STRING as an argument and reformat only lines beginning with STRING, reattaching the prefix to reformatted lines.
-g, – -goal=WIDTH option : This option refers to the goal width i.e default of 93% of width.
 – -help option : This display a help message and exit.
 – -version option : This display version information and exit.

Application of fmt command:

fmt lets you format the large text files easily with the options like -u which can be very difficult task if done manually.
fmt also lets you change the default width with the help of -w option.
◈ It is a good way to save time when it comes to format the files.

Thursday, 9 April 2020

How to Work Remotely and Securely with FOSS Tools

With the advent of global problems such as Coronavirus (COVID-19) and the need for social distancing to help mitigate the spread of such diseases, many organizations are looking to remote solutions.

LPI Study Materials, LPI Tutorial and Materials, LPI Learning, LPI Exam Prep, LPI Prep

A well-designed disaster recovery plan would already have policies in place for employees to work remotely in times of a crisis. Nonetheless, many companies are finding that they do not have such policies in place. There are likely a variety of reasons as to why an organization would not have a solution ready for employees to work remotely whether they be financial, political, or a lack of understanding of the technologies that are available.

Although office politics do not lend themselves well to easy "one size fits all" solutions, we can address the financial aspect as well as the technologies that are both feasible and accessible. We will take a look at some various solutions that are open source as well as some proprietary applications that are multi-platform to help you stay connected with your coworkers.

Remote Communications


The highest priority for any remote employee is the ability to communicate with their coworkers. Of course, we have had email for decades and practically every email platform supports the ability to send and receive messages from a plethora of desktop and mobile applications, regardless of the operating system or client used thanks to predefined standards such as SMTP, POP, and IMAP (and their secure alternatives).

Nowadays, many organizations are jumping on the Slack bandwagon. Slack is a great tool and very easy to work with, but there are some caveats to its usage. First off, the Slack infrastructure is entirely owned and operated by the company behind the software itself. This means that your organization does not have control over retention or backups of your messages without further costs. There is also an extra cost to the usage of Slack depending on how many messages or the size of the messages that your account consumes.  Neither does your business have control over the security of these messages.

A great alternative to Slack is Mattermost.  Mattermost possesses nearly all of the features that you would find in Slack, as well as the ability to run the client application on any mobile device and it offers a multi-platform desktop application. The extra upside to Mattermost is that it is open source software, and you can host it on your own servers or within Docker containers.  Your organization has complete control over all message retention, backups, security updates and policy controls. For the security-minded company, Mattermost is an excellent choice over Slack.

Zoom is another very popular multi-platform communications application that many organizations depend on for their meetings held via teleconferencing.  As of late there have been some security issues related to how Zoom can leak personal information. There are easy fixes to these as the articles point out, but would it not be better to use an open source application that gives greater preference to security?

This is where promising projects such as Jitsi could be used.  Jitsi is fully open source software, utilizes WebRTC (an internet standard) and end-to-end encryption for all of its calls.  There is no need to register an account with a hosting company, as the server software is available for an organization to install and run on its own.  A caveat to Jitsi is that at this time there are no mobile applications.  Yet given the open source nature of the code and an increase in adoption of Jitsi, such a hurdle could be easily overcome.

Remote Collaboration


The above software packages are a given for remote collaboration, but we now turn our focus to document, calendar and contact sharing.

Many organizations may have access to G Suite and its associated web-based applications.  However, these are hosted and controlled by Google and the business offerings are not free.  Pricing for this platform varies depending on how many users in the organization are going to use the applications and which advanced features a business would need.  As with most software solutions, there is a FOSS alternative.

The flagship platform for such tasks is none other than Nextcloud.  Nextcloud is an extremely versatile, highly scalable and fully open source solution for cloud-based office services.  Nextcloud has recently taken their excellent software to a new level with their Hub offering which allows groups to collaborate together on documents, conduct secure video teleconferencing via its Talk plugin, as well as self-managed groupware capabilities for email, contacts and calendaring.  Much of the functionality that can be found within Google’s G Suite can be duplicated within Nextcloud with its plethora of plugins.  The best part is, your organization controls the data instead of a third party.

The GNOME desktop environment also offers built-in functionality (via Settings>Online Accounts) to connect to multiple Nextcloud instances.  This way you can seamlessly synchronize your calendar, contacts, files and more on your Linux system.  If you do not use the GNOME desktop there are also Nextcloud clients available within distribution package repositories, as well as a flatpak package or a snapcraft package depending on your choice of installation method.

Remote Connectivity


One final topic that we should look at is the ability to connect from your home office back to your business office’s network.  The primary method with which this is done is through a VPN (virtual private network) connection.  VPN solutions are typically maintained by a business’ information technology department and access to a VPN would have to be granted by the IT department. 

Nonetheless NetworkManager, the default networking utility installed on most Linux distributions, has the ability to connect to numerous types of VPN systems.  There is support for OpenVPN, Cisco’s AnyConnect by way of the OpenConnect plugin as well as the vpnc plugin.

If you do not have a VPN solution for your business, there are open source solutions available through projects such as OPNsense and pfSense.  Both of these projects offer full-featured firewall solutions as well as VPN capabilities.  These platforms are built on FreeBSD and offer solid performance and security.  They can both be easily installed on commodity hardware with at least two network interfaces, bringing commercial-grade firewall solutions to your organization.  Should you need extended features and more scalability, these two projects also offer paid enterprise services to implement such functionality.

Once you have connected to your office’s network, you can use applications such as Remmina to connect to Windows, macOS, or Linux workstations and servers.  Remmina makes it easy to organize saved connections should you need to connect to multiple systems.  It can also handle SSH connections for Linux server administrators, making it easy to categorize a number of connection types based on a server's usage (such as production, testing, QA, etc.).

Summing Up


With many stay-at-home orders being issued by various government entities, many people are finding that they still need to find efficient, secure and cost-effective methods for continuing their work.  The FOSS community has been developing remote solutions for a variety of use-cases for years.  Now, more than ever, the efforts of these developers can be appreciated by those who have never had the need to leave their offices before.

Source: lpi.org

Tuesday, 7 April 2020

Unix / Linux - File Management

We will discuss in detail about file management in Unix. All data in Unix is organized into files. All files are organized into directories. These directories are organized into a tree-like structure called the filesystem.

Linux Tutorial and Material, Linux Learning, Linux Cert Exam, LPI Prep

When you work with Unix, one way or another, you spend most of your time working with files. This post will help you understand how to create and remove files, copy and rename them, create links to them, etc.

In Unix, there are three basic types of files −

◉ Ordinary Files − An ordinary file is a file on the system that contains data, text, or program instructions. In this post, you look at working with ordinary files.

◉ Directories − Directories store both special and ordinary files. For users familiar with Windows or Mac OS, Unix directories are equivalent to folders.

◉ Special Files − Some special files provide access to hardware such as hard drives, CD-ROM drives, modems, and Ethernet adapters. Other special files are similar to aliases or shortcuts and enable you to access a single file using different names.

Listing Files


To list the files and directories stored in the current directory, use the following command −

$ls

Here is the sample output of the above command −

$ls

bin        hosts  lib     res.03
ch07       hw1    pub     test_results
ch07.bak   hw2    res.01  users
docs       hw3    res.02  work

The command ls supports the -l option which would help you to get more information about the listed files −

$ls -l
total 1962188

drwxrwxr-x  2 amrood amrood      4096 Dec 25 09:59 uml
-rw-rw-r--  1 amrood amrood      5341 Dec 25 08:38 uml.jpg
drwxr-xr-x  2 amrood amrood      4096 Feb 15  2006 univ
drwxr-xr-x  2 root   root        4096 Dec  9  2007 urlspedia
-rw-r--r--  1 root   root      276480 Dec  9  2007 urlspedia.tar
drwxr-xr-x  8 root   root        4096 Nov 25  2007 usr
drwxr-xr-x  2    200    300      4096 Nov 25  2007 webthumb-1.01
-rwxr-xr-x  1 root   root        3192 Nov 25  2007 webthumb.php
-rw-rw-r--  1 amrood amrood     20480 Nov 25  2007 webthumb.tar
-rw-rw-r--  1 amrood amrood      5654 Aug  9  2007 yourfile.mid
-rw-rw-r--  1 amrood amrood    166255 Aug  9  2007 yourfile.swf
drwxr-xr-x 11 amrood amrood      4096 May 29  2007 zlib-1.2.3
$

Linux Tutorial and Material, Linux Learning, Linux Cert Exam, LPI Prep
Here is the information about all the listed columns −

◉ First Column − Represents the file type and the permission given on the file. Below is the description of all type of files.

◉ Second Column − Represents the number of memory blocks taken by the file or directory.

◉ Third Column − Represents the owner of the file. This is the Unix user who created this file.

◉ Fourth Column − Represents the group of the owner. Every Unix user will have an associated group.

◉ Fifth Column − Represents the file size in bytes.

◉ Sixth Column − Represents the date and the time when this file was created or modified for the last time.

◉ Seventh Column − Represents the file or the directory name.

In the ls -l listing example, every file line begins with a d, -, or l. These characters indicate the type of the file that's listed.

Sr.No. Prefix & Description
1 -
Regular file, such as an ASCII text file, binary executable, or hard link.
b
Block special file. Block input/output device file such as a physical hard drive.
c
Character special file. Raw input/output device file such as a physical hard drive.
d
Directory file that contains a listing of other files and directories. 
l
Symbolic link file. Links on any regular file.
p
Named pipe. A mechanism for interprocess communications.
s
Socket used for interprocess communication. 

Metacharacters


Metacharacters have a special meaning in Unix. For example, * and ? are metacharacters. We use * to match 0 or more characters, a question mark (?) matches with a single character.

For Example −

$ls ch*.doc

Displays all the files, the names of which start with ch and end with .doc −

ch01-1.doc   ch010.doc  ch02.doc    ch03-2.doc 
ch04-1.doc   ch040.doc  ch05.doc    ch06-2.doc
ch01-2.doc ch02-1.doc c

Here, * works as meta character which matches with any character. If you want to display all the files ending with just .doc, then you can use the following command −

$ls *.doc

Hidden Files


An invisible file is one, the first character of which is the dot or the period character (.). Unix programs (including the shell) use most of these files to store configuration information.

Some common examples of the hidden files include the files −

◉ .profile − The Bourne shell ( sh) initialization script

◉ .kshrc − The Korn shell ( ksh) initialization script

◉ .cshrc − The C shell ( csh) initialization script

◉ .rhosts − The remote shell configuration file

To list the invisible files, specify the -a option to ls −

$ ls -a

.         .profile       docs     lib     test_results
..        .rhosts        hosts    pub     users
.emacs    bin            hw1      res.01  work
.exrc     ch07           hw2      res.02
.kshrc    ch07.bak       hw3      res.03
$

◉ Single dot (.) − This represents the current directory.

◉ Double dot (..) − This represents the parent directory.

Creating Files


You can use the vi editor to create ordinary files on any Unix system. You simply need to give the following command −

$ vi filename

The above command will open a file with the given filename. Now, press the key i to come into the edit mode. Once you are in the edit mode, you can start writing your content in the file as in the following program −

This is unix file....I created it for the first time.....
I'm going to save this content in this file.

Once you are done with the program, follow these steps −

◉ Press the key esc to come out of the edit mode.

◉ Press two keys Shift + ZZ together to come out of the file completely.

You will now have a file created with filename in the current directory.

$ vi filename
$

Editing Files


You can edit an existing file using the vi editor. We will discuss in short how to open an existing file −

$ vi filename

Once the file is opened, you can come in the edit mode by pressing the key i and then you can proceed by editing the file. If you want to move here and there inside a file, then first you need to come out of the edit mode by pressing the key Esc. After this, you can use the following keys to move inside a file −

◉ l key to move to the right side.

◉ h key to move to the left side.

◉ k key to move upside in the file.

◉ j key to move downside in the file.

So using the above keys, you can position your cursor wherever you want to edit. Once you are positioned, then you can use the i key to come in the edit mode. Once you are done with the editing in your file, press Esc and finally two keys Shift + ZZ together to come out of the file completely.

Display Content of a File


You can use the cat command to see the content of a file. Following is a simple example to see the content of the above created file −

$ cat filename
This is unix file....I created it for the first time.....
I'm going to save this content in this file.
$

You can display the line numbers by using the -b option along with the cat command as follows −

$ cat -b filename
1   This is unix file....I created it for the first time.....
2   I'm going to save this content in this file.
$

Counting Words in a File


You can use the wc command to get a count of the total number of lines, words, and characters contained in a file. Following is a simple example to see the information about the file created above −

$ wc filename
2  19 103 filename
$

Here is the detail of all the four columns −

◉ First Column − Represents the total number of lines in the file.

◉ Second Column − Represents the total number of words in the file.

◉ Third Column − Represents the total number of bytes in the file. This is the actual size of the file.

◉ Fourth Column − Represents the file name.

You can give multiple files and get information about those files at a time. Following is simple syntax −

$ wc filename1 filename2 filename3

Copying Files


To make a copy of a file use the cp command. The basic syntax of the command is −

$ cp source_file destination_file

Following is the example to create a copy of the existing file filename.

$ cp filename copyfile
$

You will now find one more file copyfile in your current directory. This file will exactly be the same as the original file filename.

Renaming Files


To change the name of a file, use the mv command. Following is the basic syntax −

$ mv old_file new_file

The following program will rename the existing file filename to newfile.

$ mv filename newfile
$

The mv command will move the existing file completely into the new file. In this case, you will find only newfile in your current directory.

Deleting Files


To delete an existing file, use the rm command. Following is the basic syntax −

$ rm filename

Caution − A file may contain useful information. It is always recommended to be careful while using this Delete command. It is better to use the -i option along with rm command.

Following is the example which shows how to completely remove the existing file filename.

$ rm filename
$

You can remove multiple files at a time with the command given below −

$ rm filename1 filename2 filename3
$

Standard Unix Streams


Under normal circumstances, every Unix program has three streams (files) opened for it when it starts up −

◉ stdin − This is referred to as the standard input and the associated file descriptor is 0. This is also represented as STDIN. The Unix program will read the default input from STDIN.

◉ stdout − This is referred to as the standard output and the associated file descriptor is 1. This is also represented as STDOUT. The Unix program will write the default output at STDOUT

◉ stderr − This is referred to as the standard error and the associated file descriptor is 2. This is also represented as STDERR. The Unix program will write all the error messages at STDERR.