Docsity

Logging In and Using Basic Commands in UNIX - Prof. Nav, Cheat Sheet of Operating Systems

Partial preview of the text

Download Logging In and Using Basic Commands in UNIX - Prof. Nav and more Cheat Sheet Operating Systems in PDF only on Docsity!

Getting Started – Unix Operating

System

Lecture Notes

Compiled by: Samuel Banning Osei

Chapter Objectives +This chapter seeks to explain the following: ohow to start and end (log in and log out) a UNIX session, othe function of passwords and how to change your password, othe command line format, oa few simple UNIX commands and their applications, ohow you can correct typing mistakes, othe process of establishing contact with UNIX in more detail, and osome internal UNIX operations

Login Name +created when your account is created +a.k.a User ID or User Name +Your User ID is unique and identifies you to the system +Respond to the login: prompt by typing your User ID and then pressing [Return ] +After you type your User ID UNIX system displays the password: prompt Figure 3-2 The Password Prompt Establishing Contact With UNIX...

Password +A password is a sequence of letters and digits used by UNIX to verify that the user is allowed to use the system +Type your password and then press [Return] +The UNIX system displays some messages +The UNIX system displays the system prompt, usually a dollar ($) or percent sign (%)

N.B: If no password has been assigned to your account, UNIX does not display the password:

prompt, and the logging-in process ends

Establishing Contact With UNIX...

©2021 [email protected] Changing Your Password: The passwd Command +The passwd is used to change the password of the current user. +If the current user does not have a password, it creates one. +Type passwd [Return] +UNIX displays the Old password: prompt

o Enter your current password and press [Return]

+UNIX displays the New password : prompt

o Enter your new password

+UNIX shows the Re-enter new password: prompt

o Retype the new password

+UNIX verifies that there is no mismatch

Figure 3 - 4a the Change Password

Prompt on UNIX

Figure 3 - 4a the Change Password

Prompt on Linux Mint

You must enter your ID and password exactly as they are known to the system. That is, lowercase or uppercase characters must be entered as lowercase and uppercase, respectively. At this point, UNIX is not forgiving, and you cannot correct your entries using the [Backspace] or [Del] keys. Establishing Contact With UNIX...

Password Format +Your UNIX password must comply with the following criteria: oThe new password must differ from the old one by at least three characters oThe password must be at least six characters long and must contain at least two characters and one number oThe password must differ from your User ID +If UNIX detects anything wrong with your password, it displays an error message and shows the New password: prompt again. Establishing Contact With UNIX...

Figure 3 - 6 Sample of Error Messages Establishing Contact With UNIX...

General Rules for Choosing Passwords +Do not use a dictionary word (in any language) +Do not use the name of a person, pet, location, or a character from a book +Do not use any variation of your name and ID/account name +Do not use known information about you, such as your phone number, birthday, etc. +Do not use a simple pattern or easy sequence of keyboard keys. e.g. asdf Establishing Contact With UNIX...

Logging Off +The process of signing off when you have finished with the system is called logging off or logging out +To log off, press [Ctrl-d], which means to simultaneously hold down the key labeled Ctrl (for Control) and press the letter d +UNIX responds first by displaying logging off messages +Then UNIX shows the system’s standard welcome message and login: prompt Establishing Contact With UNIX... Figure 3 - 7: The Logging-Out Process

Using Some Simple Commands +There are hundreds of UNIX commands and utilities +By typing the commands, you tell the UNIX system to do something. +Some basic commands you will use frequently, some you will use occasionally, and some you may never use! +The difficult part of systems such as UNIX that have a rich set of commands is learning to master the details of each command. +To execute a command, you type the command and press [Return]. oThis line of instruction is known as the command line. oUNIX interprets the press of [Return] as the end of the command line and responds by executing the command and showing the results on the screen +After executing a command, UNIX displays a new prompt, indicating that it is ready for the next command.

A Few Basic Commands +Date and time display: date +Current user information: who +The Calendar Command: cal

Date and Time Display: The date Command +The date command displays the current date and time on the screen +The date and time are set by the system administrator and users cannot change them oOnly on UNIX systems Figure 3 - 9 The date Command on UNIX Figure 3 - 9 The date Command on Linux Mint

  • who am i or whoami +UNIX displays who the system thinks you are Figure 3 - 11: The who Command with am i Argument

Commands with Options +Most commands in the UNIX have other options that can give you even more results +To view the available options for any command, type the command followed by --help oE.g. typing who --help brings up all the options one could use with the who command, and a brief description of what each option does, shown in figure 3. oLet’s try some of the options Figure 3 - 12: The help page for the who Command