Professional Documents
Culture Documents
Understanding The & Using: Linux Command Line Basic Linux Commands
Understanding The & Using: Linux Command Line Basic Linux Commands
The Linux command line is provided by a program called the shell. Over the long history
of UNIX-like systems, many shells have been developed.
A few are :
• sh
• csh
• Ksh
• zsh
• bash
What is the login shell in Linux?
Login shell. A login shell is a shell given to a user upon login into their user
account.
The Shell basics
Commands entered at the shell prompt have three basic parts:
• Command to run
• Options to adjust the behaviour of the command
• Arguments, which are typically targets of the command
A few things to know about commands (Help)
conventions:
• Square brackets, [], surround optional items.
• Anything followed by ... represents an arbitrary-length list of items of that type.
• Multiple items separated by pipes, I. means only one of them can be specified.
Chapter1. Access ing the Command Line
• Text in angle brackets, <>, represents variable data. For example, <filename>
means " insert the filename you wish to use here". Sometimes these variables are
simply written in capital letters (e.g., FILENAME).
A Simple Command example
Command:
$ date
Output:
Tue Oct 10 22:55:01 PDT 2017
Command:
$ date -u
Output :
Wed Oct 11 06:11:31 UTC 2017
:-u Option: Displays the time in GMT(Greenwich Mean Time)/UTC(Coordinated Universal Time )time
zone.
What we cover in this Session
● Standard Input/Output/Error
● What are they?
● Environment Variables
● What & Why
● How to use
● When to use
Shell variables are variables that apply only to the current shell
instance. Each shell such as zsh and bash, has its own set of internal
shell variables.
Commands available that allow you to list and set environment
variables in Linux:
set – The command sets or unset shell variables. When used without an
argument it will print a list of all variables including environment and
shell variables, and shell functions.
One of the main purposes of piping is filtering. You use piping to filter the contents
of a large file—to find a particular string or word, for example.
This purpose is why the most popular use for pipes involves the commands grep
and sort
Let’s PIPE it
ls | wc -l
ls | tr “a-z” “A-Z”