Docsity

Linux Operating System: Features, Advantages, and Commands, Assignments of Computer science

Partial preview of the text

Download Linux Operating System: Features, Advantages, and Commands and more Assignments Computer science in PDF only on Docsity!

LINUXLINUX

 Developed by Linus TorvaldsDeveloped by Linus Torvalds  Torvalds developed Linux Kernel (coreTorvalds developed Linux Kernel (core program of LINUX OS) program of LINUX OS)  Is a Multi-user Operating SystemIs a Multi-user Operating System  Standard is POSIX (Portable OperatingStandard is POSIX (Portable Operating System for the unIX) System for the unIX)  Versions – 0.02,Red Het Linux 6.0Versions – 0.02,Red Het Linux 6.

LINUX

Logging In and Logging Out

 Login: userLogin: user  Password:Password:  [user@localhost user] $[user@localhost user] $  Type exit or logoutType exit or logout

LINUX File System

 /bin – utilities of Linux/bin – utilities of Linux  /dev – device related files/dev – device related files  /etc – essential miscellaneous system programs/etc – essential miscellaneous system programs & configuration files & configuration files  /lib – libraries of data/lib – libraries of data  /home – HOME directories of users/home – HOME directories of users  /var – information specific to different utilities/var – information specific to different utilities

Directory Commands

 pwd(Print Workingpwd(Print Working Directory) Directory)  cd cd  mkdir mkdir  rmdir rmdir  lsls

  • display full path of thedisplay full path of the current directory current directory
  • changing the currentchanging the current directory directory
  • Creating a newCreating a new directory directory
  • (^) Removing directoryRemoving directory
  • Listing the directoryListing the directory names names

File Handling

 cat cat  cp cp  rm rm  mv mv

  • display the content ofdisplay the content of file file
  • Copies content ofCopies content of oldfile to new file oldfile to new file
  • Remove the fileRemove the file
  • Moving and renamingMoving and renaming file name file name

Other Linux Commands

 whowho  who am iwho am i  echoecho

  • Displays current users logged inDisplays current users logged in
  • Display current user logged inDisplay current user logged in
  • Displays messages on the screenDisplays messages on the screen Example : $ echo hello hello $

SHELL SCRIPT

VariablesVariables

Eg: college=meenakshi Eg: college=meenakshi

Reading value to a variableReading value to a variable

Eg: Eg: read mynameread myname

ExpressionExpression

$ a=5 $ a=

$ b=10 $ b=

$ c=expr $a + $b $ c=expr $a + $b

$ echo c $ echo c o/p : 15o/p : 15

ADVANCE SHELL SCRIPT

 Test and [] commandTest and [] command Eg: Eg: test $myname =“xxx”test $myname =“xxx” [ $myname = “xxx” ] [ $myname = “xxx” ]  If constructIf construct Eg: if [ $myname =“user” ] Eg: if [ $myname =“user” ] then then echo “Welcome” echo “Welcome” else else echo “Go Out” echo “Go Out” fi fi