SlideShare a Scribd company logo
1 of 8
Download to read offline
Confidentiality Statement
This document contains confidential information of Tata Consultancy Services
Limited, which is provided for the sole purpose of permitting the recipient to
evaluate the proposal submitted herewith. In consideration of receipt of this
document, the recipient agrees to maintain such information in confidence and to
not reproduce or otherwise disclose this information to any person outside the
group directly responsible for evaluation of its contents, except that there is no
obligation to maintain the confidentiality of any information which was known to the
recipient prior to receipt of such information from Tata Consultancy Services
Limited, or becomes publicly known through no fault of recipient, or is received
without obligation of confidentiality from a third party owing no obligation of
confidentiality to Tata Consultancy Services Limited.
Tata Code of Conduct
We, in our dealings, are self-regulated by a Code of Conduct as enshrined in the
Tata Code of Conduct. We request your support in helping us adhere to the Code
in letter and spirit. We request that any violation or potential violation of the Code
by any person be promptly brought to the notice of the Local Ethics Counselor or
the Principal Ethics Counselor or the CEO of TCS. All communication received in
this regard will be treated and kept as confidential.
Table of Content
1. Basic UNIX commands................................................................................................................................................5
1.1. echo command....................................................................................................................................................5
1.2. who command.....................................................................................................................................................7
TCS Internal 3
TATA CONSULTANCY SERVICES
vILP – Unix - Command Usage
Content Manual Version 1.1
December 2014
(ILP Guwahati)
TCS Internal 4
1. Basic UNIX commands
The basic Unix commands discussed in this lesson are:
• echo
• who
• bc
• passwd
• uname
• tty
• stty
1.1. echo command
It displays a line text, echo the given string or strings to standard output.
Syntax:
echo [OPTION]... [STRING]...
Tag Description
-n do not output the trailing newline
-e enable interpretation of backslash escapes
-E disable interpretation of backslash escapes (default)
--help display this help and exit
--version output version information and exit
If -e is in effect, the following sequences are recognized:
0NNN the character whose ASCII code is NNN (octal)
 backslash
a alert (BEL)
b backspace
c suppress trailing newline
f form feed
TCS Internal
n new line
r carriage return
t horizontal tab
v vertical tab
Example:
$echo Hello world
Hello world
echo * | wc
Displays the number of files (and directories) in the current directory. It accomplishes this by
piping the output of the echo command to the wc command, which simply counts the words in
the output of echo.
$echo "nnnI'm at lunch.nI'll be back at 1:00."
"nnnI'm at lunch.nI'll be back at 1:00.".
The above echo statement will print n instead of new line, for newline -e has to be used with
echo statement.
$echo -e "nnnI'm at lunch.nI'll be back at 1:00."
I'm at lunch.
I'll be back at 1:00.
Note: skips three lines and displays the message
x=5
echo “the number is $x”
outputs the following:
the number is 5
TCS Internal
1.2. who command
who command prints information about all users who are currently logged in.
Syntax:
who [OPTION]... [ FILE ] [ am i ]
TCS Internal
Examples:
$ who
Displays the username, line, and time of all currently logged-in
sessions. For example:
lucy pts/1 2014-01-17 22:42 (:0.0)
psmith pts/2 2014-01-18 09:30 (:0.0)
alan pts/3 2013-12-25 08:52 (:0.0)
neil pts/4 2014-01-05 15:33 (:0.0)
martha pts/0 2013-09-04 22:05 (:0.0)
Displays the same information, but only for the terminal session where the command was issued, for
example:
$ who am I
alan pts/3 2013-12-25 08:52 (:0.0)
Displays "all" information, and headers above each column of data, for example:
$ who -aH
NAME LINE TIME IDLE PID COMMENT EXIT
root pts/1 2014-01-17 07:01 old 5352 (:0.0)
LOGIN tty5 2014-01-17 07:01 2808 id=5
LOGIN tty4 2014-01-17 07:01 2807 id=4
LOGIN tty2 2014-01-17 07:01 2805 id=2
LOGIN tty1 2014-01-17 07:01 2804 id=1
LOGIN tty3 2014-01-17 07:01 2806 id=3
390119 pts/5 2014-01-17 11:31 10:10 2811 i
pts/8 2014-06-09 16:27
TCS Internal

More Related Content

Similar to 2_Unix_Command_Usage_-_1

ExTreM Time Sheet Time Management Software
ExTreM Time Sheet Time Management SoftwareExTreM Time Sheet Time Management Software
ExTreM Time Sheet Time Management SoftwareLantech-Soft
 
ScenarioFlextor Applications, Inc. has contacted you regard.docx
ScenarioFlextor Applications, Inc. has contacted you regard.docxScenarioFlextor Applications, Inc. has contacted you regard.docx
ScenarioFlextor Applications, Inc. has contacted you regard.docxkenjordan97598
 
Maharastra CCN NetSim Experiment Manual
Maharastra CCN  NetSim Experiment  ManualMaharastra CCN  NetSim Experiment  Manual
Maharastra CCN NetSim Experiment ManualDr Praveen Jain
 
CJ 560 Module Seven Short Pa
CJ 560 Module Seven Short PaCJ 560 Module Seven Short Pa
CJ 560 Module Seven Short PaVinaOconner450
 
Hhs en05 system_identification
Hhs en05 system_identificationHhs en05 system_identification
Hhs en05 system_identificationShoaib Sheikh
 
Oracle 11g release 2
Oracle 11g release 2Oracle 11g release 2
Oracle 11g release 2Adel Saleh
 
NetSim Experiment Manual
NetSim Experiment ManualNetSim Experiment Manual
NetSim Experiment ManualDr Praveen Jain
 
Emona tims-analog-communication-part1 2
Emona tims-analog-communication-part1 2Emona tims-analog-communication-part1 2
Emona tims-analog-communication-part1 2Subhajit Sahu
 
Maharastra EXTC NetSim Experiment Manual
Maharastra EXTC  NetSim Experiment  ManualMaharastra EXTC  NetSim Experiment  Manual
Maharastra EXTC NetSim Experiment ManualDr Praveen Jain
 
Sybase Adaptive Server Anywhere for Linux
Sybase Adaptive Server Anywhere for LinuxSybase Adaptive Server Anywhere for Linux
Sybase Adaptive Server Anywhere for Linuxmarcorinco
 
Beginning Ethical Hacking with Python.pdf
Beginning Ethical Hacking with Python.pdfBeginning Ethical Hacking with Python.pdf
Beginning Ethical Hacking with Python.pdfIndianArmy38
 
Beginning Ethical Hacking with Python.pdf
Beginning Ethical Hacking with Python.pdfBeginning Ethical Hacking with Python.pdf
Beginning Ethical Hacking with Python.pdfIndianArmy38
 
ethical hacking report
 ethical hacking report ethical hacking report
ethical hacking reportAkhilesh Patel
 
OpenSSL Basic Function Call Flow
OpenSSL Basic Function Call FlowOpenSSL Basic Function Call Flow
OpenSSL Basic Function Call FlowWilliam Lee
 
Getting Started Guide
Getting Started GuideGetting Started Guide
Getting Started Guidewebhostingguy
 
Ncsc security architecture anti patterns white paper
Ncsc security architecture anti patterns white paperNcsc security architecture anti patterns white paper
Ncsc security architecture anti patterns white paperAhmedHany Sayed
 

Similar to 2_Unix_Command_Usage_-_1 (20)

Linux class 9 15 oct 2021-5
Linux class 9   15 oct 2021-5Linux class 9   15 oct 2021-5
Linux class 9 15 oct 2021-5
 
ExTreM Time Sheet Time Management Software
ExTreM Time Sheet Time Management SoftwareExTreM Time Sheet Time Management Software
ExTreM Time Sheet Time Management Software
 
ScenarioFlextor Applications, Inc. has contacted you regard.docx
ScenarioFlextor Applications, Inc. has contacted you regard.docxScenarioFlextor Applications, Inc. has contacted you regard.docx
ScenarioFlextor Applications, Inc. has contacted you regard.docx
 
Maharastra CCN NetSim Experiment Manual
Maharastra CCN  NetSim Experiment  ManualMaharastra CCN  NetSim Experiment  Manual
Maharastra CCN NetSim Experiment Manual
 
CJ 560 Module Seven Short Pa
CJ 560 Module Seven Short PaCJ 560 Module Seven Short Pa
CJ 560 Module Seven Short Pa
 
Hhs en05 system_identification
Hhs en05 system_identificationHhs en05 system_identification
Hhs en05 system_identification
 
Oracle 11g release 2
Oracle 11g release 2Oracle 11g release 2
Oracle 11g release 2
 
NetSim Experiment Manual
NetSim Experiment ManualNetSim Experiment Manual
NetSim Experiment Manual
 
business
businessbusiness
business
 
Emona tims-analog-communication-part1 2
Emona tims-analog-communication-part1 2Emona tims-analog-communication-part1 2
Emona tims-analog-communication-part1 2
 
Maharastra EXTC NetSim Experiment Manual
Maharastra EXTC  NetSim Experiment  ManualMaharastra EXTC  NetSim Experiment  Manual
Maharastra EXTC NetSim Experiment Manual
 
Sybase Adaptive Server Anywhere for Linux
Sybase Adaptive Server Anywhere for LinuxSybase Adaptive Server Anywhere for Linux
Sybase Adaptive Server Anywhere for Linux
 
Beginning Ethical Hacking with Python.pdf
Beginning Ethical Hacking with Python.pdfBeginning Ethical Hacking with Python.pdf
Beginning Ethical Hacking with Python.pdf
 
Beginning Ethical Hacking with Python.pdf
Beginning Ethical Hacking with Python.pdfBeginning Ethical Hacking with Python.pdf
Beginning Ethical Hacking with Python.pdf
 
ethical hacking report
 ethical hacking report ethical hacking report
ethical hacking report
 
OpenSSL Basic Function Call Flow
OpenSSL Basic Function Call FlowOpenSSL Basic Function Call Flow
OpenSSL Basic Function Call Flow
 
Getting Started Guide
Getting Started GuideGetting Started Guide
Getting Started Guide
 
LiferayDocumentation-Shikhar
LiferayDocumentation-ShikharLiferayDocumentation-Shikhar
LiferayDocumentation-Shikhar
 
Ncsc security architecture anti patterns white paper
Ncsc security architecture anti patterns white paperNcsc security architecture anti patterns white paper
Ncsc security architecture anti patterns white paper
 
Spam – The Evolution
Spam – The EvolutionSpam – The Evolution
Spam – The Evolution
 

More from Gautam Raja

1_Editors_in_Unix
1_Editors_in_Unix1_Editors_in_Unix
1_Editors_in_UnixGautam Raja
 
5_Practice_Exercise_-_1
5_Practice_Exercise_-_15_Practice_Exercise_-_1
5_Practice_Exercise_-_1Gautam Raja
 
1_Introduction_to_shell
1_Introduction_to_shell1_Introduction_to_shell
1_Introduction_to_shellGautam Raja
 
5_File_Handling_Commands__vi_editor_and_environment_variables
5_File_Handling_Commands__vi_editor_and_environment_variables5_File_Handling_Commands__vi_editor_and_environment_variables
5_File_Handling_Commands__vi_editor_and_environment_variablesGautam Raja
 
4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_Commands4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_CommandsGautam Raja
 
1_Introduction_To_Unix_and_Basic_Unix_Commands
1_Introduction_To_Unix_and_Basic_Unix_Commands1_Introduction_To_Unix_and_Basic_Unix_Commands
1_Introduction_To_Unix_and_Basic_Unix_CommandsGautam Raja
 

More from Gautam Raja (7)

1_Editors_in_Unix
1_Editors_in_Unix1_Editors_in_Unix
1_Editors_in_Unix
 
5_Practice_Exercise_-_1
5_Practice_Exercise_-_15_Practice_Exercise_-_1
5_Practice_Exercise_-_1
 
1_Introduction_to_shell
1_Introduction_to_shell1_Introduction_to_shell
1_Introduction_to_shell
 
5_File_Handling_Commands__vi_editor_and_environment_variables
5_File_Handling_Commands__vi_editor_and_environment_variables5_File_Handling_Commands__vi_editor_and_environment_variables
5_File_Handling_Commands__vi_editor_and_environment_variables
 
4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_Commands4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_Commands
 
3_Use_of_WinSCP
3_Use_of_WinSCP3_Use_of_WinSCP
3_Use_of_WinSCP
 
1_Introduction_To_Unix_and_Basic_Unix_Commands
1_Introduction_To_Unix_and_Basic_Unix_Commands1_Introduction_To_Unix_and_Basic_Unix_Commands
1_Introduction_To_Unix_and_Basic_Unix_Commands
 

2_Unix_Command_Usage_-_1

  • 1. Confidentiality Statement This document contains confidential information of Tata Consultancy Services Limited, which is provided for the sole purpose of permitting the recipient to evaluate the proposal submitted herewith. In consideration of receipt of this document, the recipient agrees to maintain such information in confidence and to not reproduce or otherwise disclose this information to any person outside the group directly responsible for evaluation of its contents, except that there is no obligation to maintain the confidentiality of any information which was known to the recipient prior to receipt of such information from Tata Consultancy Services Limited, or becomes publicly known through no fault of recipient, or is received without obligation of confidentiality from a third party owing no obligation of confidentiality to Tata Consultancy Services Limited.
  • 2. Tata Code of Conduct We, in our dealings, are self-regulated by a Code of Conduct as enshrined in the Tata Code of Conduct. We request your support in helping us adhere to the Code in letter and spirit. We request that any violation or potential violation of the Code by any person be promptly brought to the notice of the Local Ethics Counselor or the Principal Ethics Counselor or the CEO of TCS. All communication received in this regard will be treated and kept as confidential.
  • 3. Table of Content 1. Basic UNIX commands................................................................................................................................................5 1.1. echo command....................................................................................................................................................5 1.2. who command.....................................................................................................................................................7 TCS Internal 3
  • 4. TATA CONSULTANCY SERVICES vILP – Unix - Command Usage Content Manual Version 1.1 December 2014 (ILP Guwahati) TCS Internal 4
  • 5. 1. Basic UNIX commands The basic Unix commands discussed in this lesson are: • echo • who • bc • passwd • uname • tty • stty 1.1. echo command It displays a line text, echo the given string or strings to standard output. Syntax: echo [OPTION]... [STRING]... Tag Description -n do not output the trailing newline -e enable interpretation of backslash escapes -E disable interpretation of backslash escapes (default) --help display this help and exit --version output version information and exit If -e is in effect, the following sequences are recognized: 0NNN the character whose ASCII code is NNN (octal) backslash a alert (BEL) b backspace c suppress trailing newline f form feed TCS Internal
  • 6. n new line r carriage return t horizontal tab v vertical tab Example: $echo Hello world Hello world echo * | wc Displays the number of files (and directories) in the current directory. It accomplishes this by piping the output of the echo command to the wc command, which simply counts the words in the output of echo. $echo "nnnI'm at lunch.nI'll be back at 1:00." "nnnI'm at lunch.nI'll be back at 1:00.". The above echo statement will print n instead of new line, for newline -e has to be used with echo statement. $echo -e "nnnI'm at lunch.nI'll be back at 1:00." I'm at lunch. I'll be back at 1:00. Note: skips three lines and displays the message x=5 echo “the number is $x” outputs the following: the number is 5 TCS Internal
  • 7. 1.2. who command who command prints information about all users who are currently logged in. Syntax: who [OPTION]... [ FILE ] [ am i ] TCS Internal
  • 8. Examples: $ who Displays the username, line, and time of all currently logged-in sessions. For example: lucy pts/1 2014-01-17 22:42 (:0.0) psmith pts/2 2014-01-18 09:30 (:0.0) alan pts/3 2013-12-25 08:52 (:0.0) neil pts/4 2014-01-05 15:33 (:0.0) martha pts/0 2013-09-04 22:05 (:0.0) Displays the same information, but only for the terminal session where the command was issued, for example: $ who am I alan pts/3 2013-12-25 08:52 (:0.0) Displays "all" information, and headers above each column of data, for example: $ who -aH NAME LINE TIME IDLE PID COMMENT EXIT root pts/1 2014-01-17 07:01 old 5352 (:0.0) LOGIN tty5 2014-01-17 07:01 2808 id=5 LOGIN tty4 2014-01-17 07:01 2807 id=4 LOGIN tty2 2014-01-17 07:01 2805 id=2 LOGIN tty1 2014-01-17 07:01 2804 id=1 LOGIN tty3 2014-01-17 07:01 2806 id=3 390119 pts/5 2014-01-17 11:31 10:10 2811 i pts/8 2014-06-09 16:27 TCS Internal