Chapter 1. Getting started with UNIX

Size: px
Start display at page:

Download "Chapter 1. Getting started with UNIX"

Transcription

1 Chapter 1. Getting started with UNIX The core of the UNIX operating system is the kernel. The kernel keeps records of all programs (commonly called processes) running on the system and shares time among these processes according to a well-defined policy. Users of the UNIX system don't have a direct interaction with the kernel. Instead, the user always works with a program called the UNIX shell. The Super user This user is created during the installation process of HP-UX. Each user in the UNIX system has a unique number associated with the user name, called a User ID. The root user has ID 0; therefore, any user with that ID has super user privileges. represents a common user while # represents a super user. To log out, use the exit command at the shell prompt. Just after the login process, a user goes into a default directory set for that user. This default directory has a special significance and is called the user's home directory. Changing Your Password passwd Old password : New password : Re-enter new password : Password changed you must have a password between six and eight characters long, and it must be a combination of characters and numbers. The command history is saved in a file called.sh_history This file is kept in the user's home directory. history -3 (last 3 used command dilplayed using history command.) date whoami pwd Command Aliases alias dir=ls (here we can use dir command instead of ls command.) & Shell Startup Files The system startup file is common for all users of the system, while user startup files can be customized for every user. The system startup file is used for tasks that are common to all system users. The system startup file is called profile and is present in the /etc directory of HP-UX. The user startup file is called.profile ("dot profile") and is placed in a user's home directory. Page 1

2 The system startup file is executed first in the startup procedure, and then the user startup file is executed. Some Simple HP-UX Commands man command is used to get help on all HP-UX commands. pwd (command is used to print working directory) /home/boota whoami (this command is used to identify who is logged in.) boota who (display login names of all users logged into the system, along with their login time) operator pts/ta Aug 30 16:05 boota pts/tb Aug 30 15:59 w (tells how long the system has been up, current time, and what the logged-in users are doing.) 4:27pm up 1 day, 12:10, 2 users, load average: 0.07, 0.08, 0.09 User tty login@ idle JCPU PCPU what operator pts/ta 4:05pm 12 -sh boota pts/tb 3:59pm w W=uptime w (uptime w do same job that w command do. Both are similar.) uname -a (display system name & version of HP-UX running on the system.) HP-UX myhp B E 9000/ user license The system name is myhp and it is running HP-UX version Chapter 2. Working with Files and Directories Creating a File cat > newfile (this command is used to create a text file& CTRL+D to save it) This is first line. <ENTER> This is the second line. <ENTER> This is third and last line. <ENTER> <CTRL-d> ls newfile (ls without any argument list all file present in current dir.) newfile ll (long listing of all files in current directory & is similar to ls -l) total 350 -rw-r boota users Aug 27 19:04 FORMAT -rw-rw-rw- 1 boota users 0 Aug 30 20:47 myf -rw-rw-rw- 1 boota users 72 Aug 30 20:47 newfile Deleting Files rm newfile (it remove file without any warning & it does not delete hidden files.) Displaying Contents of a Text File cat newfile (cat command without ">" symbole can be used to display text file contents.) Page 2

3 This is first line. This is the second line. This is third and last line. more newfile (command display next one page at a time when user hit spacebar) File Naming Rules Generally a file name in UNIX can be as long as 256 characters. There are no special names for executable files in UNIX; the file permissions show which file is executable and which is not. Any file that starts with a dot (.) is not displayed when using the ll or ls command. These are hidden or invisible files. It can be listed using ls a command. Creating Directories mkdir newdir (it make a new directory & first character in the file permissions is "d" instead of "-". ) Deleting Directories rmdir newdir (this will delete only empty directory) rm rf newdir (this will delete entire non empty directory without any warning.) Understanding Directory Structure The top-level directory is called the root directory and is represented by "/" symbol. A directory one level above is called a parent directory, while a directory one level below is called a child directory. cd /etc (command to change directory ) cp myfile anotherfile (copy content of one file to other file in same directory.) cp /etc/profile myprofile (copy profile from /etc directory to current directory with myprofile) "." is a reference to the current directory and ".." is a reference to the parent directory of the current directory. cp file1 file2 /tmp (multiple file can be copied using cp command but the destination must be a directory name.) Page 3

4 mv myfile newfile (command used to rename file here myfile renamed with newfile.) mv myfile /tmp/myfile (it can also be used to move from one directory to other.) mv file1 file2 /tmp (multiple file can be moved but destination must be a directory name.) mv I myfile /tmp/myfile (in this case it will ask to override in case of same file name.) Wildcards The * matches zero or more characters, whereas? matches only one character. ls myfile* myfile myfile00 myfile01 myfile010 ls myfile0? myfile00 myfile01 (Here myfile010 has not been listed.) cp * /tmp (this can be used to copy all file from current directory to other directory.) grep root /etc/* (used to find word root from all file of /etc directory.) ls /etc/[w,x]* ( [] this is used to give the range ) /etc/wall /etc/whodo /etc/wtmp /etc/xtab file /etc/profile (command is able to detect the type of file.) /etc/profile: ascii text Searching a Word grep Mark /etc/passwd mstyle:elby:2216:125:mark Style,,,:/home/mstyle:/usr/bin/sh mbuna:tqfwuno:2318:125:mark Buna,,,:/home/mbuna:/usr/bin/sh grep I (to make a search case insensitive,) grep c (without displaying the lines containing the string) grep v (all lines that don't match the string pattern are displayed.) head /etc/passwd (head command display first 10 line.) tail -n 3 /etc/passwd (it will display last 3 line of a file.) tail -f (This is a very useful tool to see text being added.) wc /etc/profile (to count lines, words, and characters.) /etc/profile ln myfile abc ( command to create a hard link to a file abc, to a file, myfile ln command is used.) ln -s myfile abc (To create a soft link, we use the -s option.) Chapter 3. Environment Variables you can set a variable at the command prompt just by entering a variable name followed by an "=" sign and the value you want to assign to the variable. a variable name can start with characters of the alphabet only, not with numbers. VAR3=TestVar The echo command is used to view the value of a particular shell variable. echo VAR3 TestVar If you want to list all variables known to your current shell, use the set command. set Page 4

5 EDITOR=vi EPC_DISABLED=TRUE NAME="Mike Ron" (To set variables containing multiple words we use single or double quotes.) Modifying a Variable NAME="NAME Junior" echo NAME Mike Ron Junior A shell variable can be removed by the unset command on HP-UX. NAME="Mike Ron" echo NAME Mike Ron unset NAME echo NAME sh: NAME: Parameter not set. echo "My login name is `whoami`" My login name is boota Chapter 4. Input/Output Redirection and Pipes File descriptor 0 is used with standard input, 1 with standard output, and 2 with standard error. To redirect the output of the cat command we use the following step. cat newfile > file1 (Now the cat command displayed nothing, as the output of the command is redirected to a file. If we check the contents of file file1, it will contain the same text as newfile) Appending to a File cat file1 >>file2 (This command means that file2 still contains the old contents of file2. In addition to this, the contents of file1 are added to the end of file2.) Redirecting Standard Input mail jane <myfile (The mail program sends an message to user jane on the current system consisting of the contents of myfile) Redirecting Standard error ll xyz 2>abc (Now there is nothing displayed because the error message has been stored in a file with name abc.) Page 5

6 Chapter 5. Using the vi Editor Modes Used in vi There are three modes used in the vi editor. These are the command mode, the last line mode, and the insert or input mode. The insert mode is also called the text entry mode. When you start vi, it is in command mode. This means that whatever you type is considered a command by the editor. You can switch to text entry mode or insert mode by pressing i at any time in the command mode. ESC key is used to come out from text mode to command mode. Starting and Stopping vi The editor is started when you use a vi command and give a file name as its argument. vi myfile To save the file use the :w command. After you save the file, you can quit the editor with the :q command. You can also use :x or :wq to save and quit in one step. Note that you can use the vi command without any file name. In that case the editor will start with an unnamed file buffer in the memory. When you need to save a file, you can use :w filename instead of :w in the command mode. Multiple files can be opened with vi by supplying multiple file names at the command line. If you want to open three files (file1, file2, file3) simultaneously, the command will be as follows. vi file1 file2 file3 If you made some changes to a file and don't want to save them, you can quit the vi editor with the :q! command. You can add the exclamation symbol to any command when you want to force vi to do something. Cursor Movement Table 5-1. Cursor Movement Commands Command Effect l Move one character right h Move one character left j Move one line down k Move one line up <space> Move one character right G Go to last line of the file ng Go to line number n in the file Go to end of current line ^ Go to start of line w Go to beginning of next word b Go to beginning of previous word e Move to end of word H Go to first line of screen M Go to middle line of screen L Go to last line of screen ( Go to beginning of sentence ) Go to end of sentence { Go to beginning of paragraph } Go to end of paragraph Page 6

7 Inserting and Deleting Text HP UNIX NOTES BY Mr.SHIV KUMAR SUMAN Page 7

8 Undo and Redo You use the u command to undo the last change. You can also use the U command to undo all changes made to the current line. To redo something changed by undo, you can use the "." (dot) command. Page 8

9 Search and Replace Page 9

10 Cut, Copy, and Paste HP UNIX NOTES BY Mr.SHIV KUMAR SUMAN Importing and Exporting Text To insert a disk file into a location in the opened file, we use the :r filename command. You can export any number of lines so that they are saved as a new file on the disk. We use the w command for this purpose. As an example, if you have opened file1 in the editor and want to save lines 3 to 47 as file3, you can use the command :3,47w file3. If you want to save the opened file as a new file (to make a backup), the same command can be used without line numbers. To save the current file as file4, you use :w file4. Page 10

11 The vi editor has a configuration file with the name.exrc, which is stored in the home directory of each user. Chapter 6. Regular Expressions Page 11

12 Chapter 7. File Permissions There are three types of users in UNIX. They are: 1. the owner 2. the group 3. others Types of File Permissions For a proper operation, a directory should have read and execute permissions set. The following rules apply to directory permissions in addition to general file permissions: If read permission for a directory is not set, no file inside the directory can be listed or accessed. If execute permission of a directory is not set, files inside the directory can be listed with names only. This means ls will work but ll will not work. Also, no files inside the directory can be read or executed. Because of this, the execute permission for a directory is also called list permission. If only execute permission is set and read or write permissions are not set, a user can go into the directory with the cd command and execute a program inside the directory if the program name is known. Also, a file can be viewed with the cat command if the file name is already known. It means you can execute programs but can't see the files. If a directory contains a file that a user can't delete (no write permission), he or she can't delete the directory even though write permission is granted for the directory. Modifying File Permissions The superuser or owner of a file can modify its permissions. We use the chmod command for modifying permissions of a file. To grant permission to a user, we use the "+" symbol between the user and file modes. To revoke a permission, use "-" between the user and file modes. To exactly assign a permission, regardless of the previous permission, we use the "=" symbol. Page 12

13 Command to give same permission to all user = sign can be used. Page 13

14 Changing File Permissions Using Octal Numbers r= 4, w=2, x=1 A file that has all the permissions set can be considered as carrying weight 7 (4+2+1). If we want to grant all three (read, write, execute) permissions to all users, we can use 777 with chmod. Default File Permissions We can control default file permissions with the umask command. The umask command sets the mask for new files. The current mask value is displayed with the umask command when used without any argument. A new mask value can be set at any time. A better place for setting the mask value is the user startup file HOME/.profile so that the value is set as soon as a user logs in. Changing the Owner and Group of a File Any user other than the owner of the file can't change ownership of a file, except the superuser. chown - for changing the owner of a file. chgrp - for changing the group of a file. Page 14

15 Page 15

16 Special File Permissions HP UNIX NOTES BY Mr.SHIV KUMAR SUMAN There are three types of special file attributes: set user ID (SETUID), set group ID (SETGID), and sticky bit. We use the chmod command to set these special permissions to a file. If you are using a symbolic method, use u+s for setting SETUID and g+s for setting SETGID. Digit 4 represents SETUID and 2 represents SETGID. UID=4,GID=2 and Sticky Bit=1. As you can see, "x" is replaced by "s" in the file permission representation with either SUID or SGID. Sticky Bit The sticky bit is represented by "t" and can be set using the chmod command with the u+t symbolic method or 1 (one) in the fourth digit position of octal numbers. Finding Files Having a Particular Set of File Permissions If a system administrator wants to The following command lists all files for which SETUID is set, and anybody from group or others also has write permission to that file. find / -perm -u+s,g+w,o+w The id command is used to display the current user and group IDs. The switch user ID (su) command is used to change the user ID temporarily just as you used the newgrp command to change the group ID. Page 16

17 Listing ACL Changing ACL The newgrp Command Page 17

18 Chapter 8. UNIX File System Hierarchy Static and Dynamic Files There are two major types of file system hierarchies used in UNIX distributions. One of these is based on Berkley Distribution of UNIX (BSD) and the other is AT&T System V. The file system layout of HP-UX version 10.x and above is based on AT&T system V release 4 (SVR4). There are two major groups of these directories. One is the group in which system files are present and don't change frequently. This is the static part of the directory hierarchy. The other group contains those files and directories that are changed on a routine basis and are sometimes called dynamic files and directories. Static files and directories contain information that usually does not change after system installation. This part contains /sbin, /usr, /var, /tmp and the application directories under /opt. The Root Directory ( / ) All of the file system is viewed with reference to the root directory. The name root comes from the logical position of this directory. It is represented by a slash character (/). The Device Directory (/dev) The device directory contains all of the device files and are used to represent devices attached to the system. Files related to one type of device are kept in one subdirectory under /dev. Page 18

19 Figure 8-2. The device directory (/dev) hierarchy. The /etc Directory The /etc directory is where a system administrator spends much of his or her time. All of the system configuration files are placed in this directory. Files in the /etc/rc.config.d directory are configuration and control files for system startup and shutdown and other server and daemon processes and Files in the /etc/opt directory contain configuration files for applications installed on the system. A system administrator cannot place system configuration files in a directory other than /etc. Figure 8-3. The /etc directory hierarchy. The Home Directory (/home) This directory contains the home directories of all system users. A home directory for user linda will be /home/linda. The System Binary Directory (/sbin) This directory contains executable files needed at boot time. Under HP-UX, this directory also contains system scripts required at startup and shutdown time. Page 19

20 The most important script in the /sbin directory is the rc script that controls all of the system startup and shutdown processes. Figure 8-4. The /sbin directory subtree. The /stand Directory This is the directory where the HP-UX kernel is kept. The kernel configuration file is also present in this directory. The kernel file is /stand/vmunix and the configuration file is /stand/system. It also contains the /stand/build directory used to rebuild the new kernel. The /net Directory This is a reserved name for remote file system mount points. The Application Directory (/opt) The /opt directory is used for installing applications on an HP-UX system. The Temporary File Directory (/tmp) This directory has permissions for everybody to create or delete files. Most of the time, temporary files are placed in this directory and are deleted from time to time. Any applications that need to create temporary files should do so in the /var/tmp directory instead of /tmp. Page 20

21 The /usr Directory This is an important directory, as most of the HP-UX system files are placed here. The most important file types are user-related commands, libraries, documentation and manual pages, contributed software, and X-Window system files. Figure 8-6. Structure of the /usr directory /usr/bin This directory contains user commands, applications, and utilities. /usr/contrib Contains contributed software from other sources. /usr/include Header and include files used for programming. /usr/lib Libraries for programming and machine-dependent database files. A user may need to look into this directory to check the existence of certain libraries in case there are compilation or run-time errors. /usr/sbin Many system administration commands are placed here. /usr/share/man Manual pages for HP-UX commands. The Variable Files Directory (/var) This directory contains basically three types of files: log files, spool files, and temporary files created by applications. Page 21

22 Figure 8-7. Structure of the /var directory. Log Files Spool Files (/var/spool) Spool files related to print services are kept in the /var/spool/lp directory. Spool files for electronic mail go into /var/mail. Other spool files are kept in a directory under /var/spool. Temporary var files (/var/tmp) Temporary files generated by some applications go into the /var/tmp directory. The mail system also keeps its temporary files in the /var/mail directory. The lost+found Directory These files are usually created by the fsck command, which is used to check file system integrity from time to time and at boot time. The files that have no valid links are copied to this directory. Each file system contains one lost+found directory. Page 22

23 Some Useful Commands Related to File System Hierarchy The which Command which ls /usr/bin/ls This command is used to find out that in which directory command or executable files are located. The whereis Command whereis cat cat: /sbin/cat /usr/bin/cat /usr/share/man/man1.z/cat.1 This command is used to find or search and locate source, binary, and manual pages. Page 23

24 Chapter 9. Working with the POSIX Shell and Job Control POSIX Shell Capabilities The POSIX shell is the default shell for HP-UX users. There are two other shells used in HP-UX. One of these is called the restricted shell (/usr/bin/rsh), which is used to provide restricted access to some users. The key shell (/usr/bin/keysh) is a contextsensitive shell that may be handy to use with HP terminals. Controlling Resources (ulimit) The ulimit command is an intrinsic command of the POSIX shell and is used to limit user resources. This command is very useful if you want to specify a limit for resources. ulimit -c 1024 ulimit a Page 24

25 To reexecute a previous command, you use the r command with the command number. history date r 451 Foreground and Background Jobs The user can't issue another command until the job is finished and the command prompt is back. If you want to start more than one job simultaneously, you need to start them in the background. To start a job in the background you can put the & symbol at the end of your command prompt. Usually, the jobs that don't need any interactive input are started in the background. ll /usr >mylist & [1] You can also list background-running jobs with the jobs command. jobs [1] + Stopped vi myfile [2] - Running vi file2 + sign means this is the current running command and means it will execute after completion of first. A -l switch with the jobs command shows the PID of all jobs. All suspended jobs can be resumed with the foreground (fg) command. The same command is used to bring background jobs to the foreground. fg %2 Job numbers are used with the percent (%) symbol with the fg command. Stopping a Running Job There is no direct way to stop a running job. We can bring a background job into the foreground and then suspend it. Waiting for Background Jobs to Finish At any point, if you want to wait for background jobs to be finished, just use the wait command. This command stops the command prompt until all background jobs are finished. wait To finish all background job. wait %2 To finish particular background job. Page 25

26 Chapter 10. Introduction to Shell Programming Anatomy of a Shell Program Let us go directly to our first program and analyze it. I have used the file name script-00 for this program. Contents of this file are shown below using the cat command. cat script-00 #!/usr/bin/sh # This is to show what a script looks like. echo "Our first script" echo " " echo # This inserts an empty line in output. echo "We are currently in the following directory" pwd echo echo "This directory contains the following files ls Before looking into the program and explaining what each line does, let us see what happens if we execute it. We execute it from the current directory with the command line:./script-00 Our first script We are currently in the following directory /home/boota This directory contains the following files PHCO_18132.depot myfile phco_18132.txt PHCO_18132.text phco_18131.txt script-00 The first program line shows which HP-UX shell will be used to execute commands found in the program. And is always starts with #! character combination and shows the full path of the executable program that will be used as shell. The subshell that will be used to execute the program is /usr/bin/sh, which is the POSIX shell. You can use other shells, such as C, by changing this to /usr/bin/csh. The echo command without any argument just prints a blank line. Steps for Creating a Shell Program In the first step, a file is created that contains commands and control structures. In the second step, you need to modify file permissions to make it executable. use the chmod u+x command to make it executable. Page 26

27 Debugging Shell Programs HP UNIX NOTES BY Mr.SHIV KUMAR SUMAN Debugging shell programs is a tricky business. You replace the first line of the program #!/usr/bin/sh with #!/usr/bin/sh -x. After that, when you execute the program, it displays each line on your terminal screen before executing it. The actual line present in the program is shown with a plus (+) sign in the start of the line. After that, its output is displayed../script-00 + echo Our first script Our first script + echo echo + echo We are currently in the following directory We are currently in the following directory + pwd /home/operator + echo + echo This directory contains the following files This directory contains the following files + ls PHCO_18132.depot myfile phco_18132.txt PHCO_18132.text phco_18131.txt script-00 Using Variables cat script-01 #!/usr/bin/sh echo "Use of Variables" echo " " echo TAB=table FUR=furniture echo "The TAB is an example of FUR" When this program is executed, the results are:./script-01 Use of Variables The table is an example of furniture Page 27

28 cat script-02 #!/usr/bin/sh echo "Use of Variables" echo " " echo TAB=table FUR=furniture echo "The TAB is an example of FUR" TAB=chair Echo "After change" echo "The TAB is an example of FUR" When this program is executed, the results are as follows. Note that the line used for printing the text is the same; only the variable value is changed../script-01 Use of Variables The table is an example of furniture After change The chair is an example of furniture Using Command Line Arguments, or Positional Parameters Page 28

29 Let's see script-05, which shows how many command line arguments are provided, a list of all arguments, and the value of the first argument. This program is now shown using the cat command. cat script-05 #!/usr/bin/sh echo "Total number of command line arguments is: #" echo "These arguments are: *" echo "The first argument is: 1" When you execute the program with three arguments red, green, and blue, the result is as shown below../script-05 red green blue Total number of command line arguments is: 3 These arguments are: red green blue The first argument is: red The shift Command The shift command is used to move the command line arguments one position left. The first argument is lost when you use the shift command. Shifting command line arguments is useful when you perform a similar action to all arguments, one-by-one, without changing the variable name. The shift command throws away the left-most variable (argument number 1) and reassigns values to the remaining variables. The value in 2 moves to 1, the value in 3 moves to 2, and so on. Let's modify script-05 into script-06 as shown below using the cat command. cat script-06 #!/usr/bin/sh echo "Total number of command line arguments is: #" echo "These arguments are: *" echo "The first argument is: 1" shift echo "New first argument after shift: 1" shift echo "First argument after another shift: 1" Now let's execute script-06 with the same three arguments we used with script-05. You can see from the next result that after every shift, a new value is assigned to 1. This value is the variable that is just on the right side of 1 (i.e., 2)../script-06 red green blue Total number of command line arguments is: 3 These arguments are: red green blue The first argument is: red New first argument after shift: green Page 29

30 First argument after another shift: blue During the first shift operation, 1 value is lost forever and can't be recovered by the program. The shift command can also do multiple shift operations in one step. For this you need to supply an argument to the shift command. For example, shift 2 will shift two arguments in one step, such that the old values of 1 and 2 will be lost, the value of 3 will be assigned to 1, the value of 4 will be assigned to 2, and so on. Interactive Shell Programs Interactive shell programs can read user input at run time with the help of the read command. Most of the time you will use the echo command to display a message before the read command is executed. This message informs the user of what the program is expecting. These programs are used in situations where a program first checks some system parameter and then requires user input to perform an operation on it. As an example, if you want to talk to another user on the system, you may first want to see who is logged into the system. After getting a list of users, you may initiate conversation with a particular user using the talk command. The read Command The read command takes one line of input from the user and assigns it to a variable. The variable name is provided as an argument to the read command. After entering some text, the user presses the key. Below is script-07, which lists all users currently logged into the system and then waits for you to enter a user name. After getting the user name, it initiates conversation with that user using the talk command. cat script-07 #!/usr/bin/sh echo "Currently logged in users are:" who echo echo echo "Enter the name of the user to whom you want to talk" read NAME echo "initiating talk with NAME" talk NAME After you select a user, the program rings the other party and displays a message asking the other user to respond to your talk request. If that user accepts your request, a talk window appears. Before the talk window appears, the program executes as shown below. Here you initiate a talk session with a user linda../script-07 Currently logged in users are: boota pts/t0 Oct 18 17:53 linda pts/0 Oct 18 22:13 Enter the name of the user to whom you want to talk linda <The talk window appears which covers the full screen> The echo Command You have already used the echo command to display text on your screen. This command uses escape characters that can be used to format the displayed text to enhance its readability. The escape characters used with the echo command are listed in Table Page 30

31 Exit code Page 31

32 Page 32

33 Page 33

34 Page 34

35 Page 35

36 Page 36

37 Page 37

38 Page 38

39 Page 39

40 Page 40

41 Page 41

Outline. Structure of a UNIX command

Outline. Structure of a UNIX command Outline Structure of Unix Commands Command help (man) Log on (terminal vs. graphical) System information (utility) File and directory structure (path) Permission (owner, group, rwx) File and directory

More information

Unix Introduction to UNIX

Unix Introduction to UNIX Unix Introduction to UNIX Get Started Introduction The UNIX operating system Set of programs that act as a link between the computer and the user. Developed in 1969 by a group of AT&T employees Various

More information

Essential Unix (and Linux) for the Oracle DBA. Revision no.: PPT/2K403/02

Essential Unix (and Linux) for the Oracle DBA. Revision no.: PPT/2K403/02 Essential Unix (and Linux) for the Oracle DBA Revision no.: PPT/2K403/02 Architecture of UNIX Systems 2 UNIX System Structure 3 Operating system interacts directly with Hardware Provides common services

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Mukesh Pund Principal Scientist, NISCAIR, New Delhi, India History In 1969, a team of developers developed a new operating system called Unix which was written using C Linus Torvalds,

More information

IMPORTANT: Logging Off LOGGING IN

IMPORTANT: Logging Off LOGGING IN These are a few basic Unix commands compiled from Unix web sites, and printed materials. The main purpose is to help a beginner to go around with fewer difficulties. Therefore, I will be adding to this

More information

Working with Basic Linux. Daniel Balagué

Working with Basic Linux. Daniel Balagué Working with Basic Linux Daniel Balagué How Linux Works? Everything in Linux is either a file or a process. A process is an executing program identified with a PID number. It runs in short or long duration

More information

CS4350 Unix Programming. Outline

CS4350 Unix Programming. Outline Outline Unix Management Files and file systems Structure of Unix Commands Command help (man) Log on (terminal vs. graphical) System information (utility) File and directory structure (path) Permission

More information

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018 GNU/Linux 101 Casey McLaughlin Research Computing Center Spring Workshop Series 2018 rccworkshop IC;3df4mu bash-2.1~# man workshop Linux101 RCC Workshop L101 OBJECTIVES - Operating system concepts - Linux

More information

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories Chapter Two Exploring the UNIX File System and File Security Lesson A Understanding Files and Directories 2 Objectives Discuss and explain the UNIX file system Define a UNIX file system partition Use the

More information

Files and Directories

Files and Directories CSCI 2132: Software Development Files and Directories Norbert Zeh Faculty of Computer Science Dalhousie University Winter 2019 Files and Directories Much of the operation of Unix and programs running on

More information

Unix Handouts. Shantanu N Kulkarni

Unix Handouts. Shantanu N Kulkarni Unix Handouts Shantanu N Kulkarni Abstract These handouts are meant to be used as a study aid during my class. They are neither complete nor sincerely accurate. The idea is that the participants should

More information

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions Welcome to getting started with Ubuntu 12.04 Server. This System Administrator Manual guide to be simple to follow, with step by step instructions with screenshots INDEX 1.Installation of Ubuntu 12.04

More information

CS/CIS 249 SP18 - Intro to Information Security

CS/CIS 249 SP18 - Intro to Information Security Lab assignment CS/CIS 249 SP18 - Intro to Information Security Lab #2 - UNIX/Linux Access Controls, version 1.2 A typed document is required for this assignment. You must type the questions and your responses

More information

Introduction to the UNIX command line

Introduction to the UNIX command line Introduction to the UNIX command line Steven Abreu Introduction to Computer Science (ICS) Tutorial Jacobs University s.abreu@jacobs-university.de September 19, 2017 Overview What is UNIX? UNIX Shell Commands

More information

Std: XI CHAPTER-3 LINUX

Std: XI CHAPTER-3 LINUX Commands: General format: Command Option Argument Command: ls - Lists the contents of a file. Option: Begins with minus sign (-) ls a Lists including the hidden files. Argument refers to the name of a

More information

Appendix B WORKSHOP. SYS-ED/ Computer Education Techniques, Inc.

Appendix B WORKSHOP. SYS-ED/ Computer Education Techniques, Inc. Appendix B WORKSHOP SYS-ED/ Computer Education Techniques, Inc. 1 Introduction There are no workshops for this chapter. The instructor will provide demonstrations and examples. SYS-ED/COMPUTER EDUCATION

More information

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines Introduction to UNIX Logging in Basic system architecture Getting help Intro to shell (tcsh) Basic UNIX File Maintenance Intro to emacs I/O Redirection Shell scripts Logging in most systems have graphical

More information

The Unix Shell & Shell Scripts

The Unix Shell & Shell Scripts The Unix Shell & Shell Scripts You should do steps 1 to 7 before going to the lab. Use the Linux system you installed in the previous lab. In the lab do step 8, the TA may give you additional exercises

More information

UNIX File Hierarchy: Structure and Commands

UNIX File Hierarchy: Structure and Commands UNIX File Hierarchy: Structure and Commands The UNIX operating system organizes files into a tree structure with a root named by the character /. An example of the directory tree is shown below. / bin

More information

h/w m/c Kernel shell Application s/w user

h/w m/c Kernel shell Application s/w user Structure of Unix h/w m/c Kernel shell Application s/w. user While working with unix, several layers of interaction occur b/w the computer h/w & the user. 1. Kernel : It is the first layer which runs on

More information

Introduction: What is Unix?

Introduction: What is Unix? Introduction Introduction: What is Unix? An operating system Developed at AT&T Bell Labs in the 1960 s Command Line Interpreter GUIs (Window systems) are now available Introduction: Unix vs. Linux Unix

More information

Chapter-3. Introduction to Unix: Fundamental Commands

Chapter-3. Introduction to Unix: Fundamental Commands Chapter-3 Introduction to Unix: Fundamental Commands What You Will Learn The fundamental commands of the Unix operating system. Everything told for Unix here is applicable to the Linux operating system

More information

Set 1 MCQ Which command is used to sort the lines of data in a file in reverse order A) sort B) sh C) st D) sort -r

Set 1 MCQ Which command is used to sort the lines of data in a file in reverse order A) sort B) sh C) st D) sort -r 1. Which symbol will be used with grep command to match the pattern pat at the beginning of a line? A) ^pat B) $pat C) pat$ D) pat^ 2. Which command is used to sort the lines of data in a file in reverse

More information

bash startup files Linux/Unix files stty Todd Kelley CST8207 Todd Kelley 1

bash startup files Linux/Unix files stty Todd Kelley CST8207 Todd Kelley 1 bash startup files Linux/Unix files stty Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 midterms (Feb 27 and April 10) bash startup files More Linux Files review stty 2 We customize our

More information

This lab exercise is to be submitted at the end of the lab session! passwd [That is the command to change your current password to a new one]

This lab exercise is to be submitted at the end of the lab session! passwd [That is the command to change your current password to a new one] Data and Computer Security (CMPD414) Lab II Topics: secure login, moving into HOME-directory, navigation on Unix, basic commands for vi, Message Digest This lab exercise is to be submitted at the end of

More information

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering ENG224 Information Technology Part I: Computers and the Internet Laboratory 2 Linux Shell Commands and vi Editor

More information

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University Unix/Linux Basics 1 Some basics to remember Everything is case sensitive Eg., you can have two different files of the same name but different case in the same folder Console-driven (same as terminal )

More information

CS Unix Tools. Lecture 2 Fall Hussam Abu-Libdeh based on slides by David Slater. September 10, 2010

CS Unix Tools. Lecture 2 Fall Hussam Abu-Libdeh based on slides by David Slater. September 10, 2010 Lecture 2 Fall 2010 Hussam Abu-Libdeh based on slides by David Slater September 10, 2010 Last Time We had a brief discussion On The Origin of Species *nix systems Today We roll our sleeves and get our

More information

5/8/2012. Encryption-based Protection. Protection based on Access Permission (Contd) File Security, Setting and Using Permissions Chapter 9

5/8/2012. Encryption-based Protection. Protection based on Access Permission (Contd) File Security, Setting and Using Permissions Chapter 9 File Security, Setting and Using Permissions Chapter 9 To show the three protection and security mechanisms that UNIX provides To describe the types of users of a UNIX file To discuss the basic operations

More information

A Brief Introduction to the Linux Shell for Data Science

A Brief Introduction to the Linux Shell for Data Science A Brief Introduction to the Linux Shell for Data Science Aris Anagnostopoulos 1 Introduction Here we will see a brief introduction of the Linux command line or shell as it is called. Linux is a Unix-like

More information

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs Summer 2010 Department of Computer Science and Engineering York University Toronto June 29, 2010 1 / 36 Table of contents 1 2 3 4 2 / 36 Our goal Our goal is to see how we can use Unix as a tool for developing

More information

Computer Systems and Architecture

Computer Systems and Architecture Computer Systems and Architecture Stephen Pauwels Computer Systems Academic Year 2018-2019 Overview of the Semester UNIX Introductie Regular Expressions Scripting Data Representation Integers, Fixed point,

More information

Unix as a Platform Exercises + Solutions. Course Code: OS 01 UNXPLAT

Unix as a Platform Exercises + Solutions. Course Code: OS 01 UNXPLAT Unix as a Platform Exercises + Solutions Course Code: OS 01 UNXPLAT Working with Unix Most if not all of these will require some investigation in the man pages. That's the idea, to get them used to looking

More information

QUESTION BANK ON UNIX & SHELL PROGRAMMING-502 (CORE PAPER-2)

QUESTION BANK ON UNIX & SHELL PROGRAMMING-502 (CORE PAPER-2) BANK ON & SHELL PROGRAMMING-502 (CORE PAPER-2) TOPIC 1: VI-EDITOR MARKS YEAR 1. Explain set command of vi editor 2 2011oct 2. Explain the modes of vi editor. 7 2013mar/ 2013 oct 3. Explain vi editor 5

More information

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester Linux Essentials Programming and Data Structures Lab M Tech CS First Year, First Semester Adapted from PDS Lab 2014 and 2015 Login, Logout, Password $ ssh mtc16xx@192.168.---.--- $ ssh X mtc16xx@192.168.---.---

More information

Mills HPC Tutorial Series. Linux Basics I

Mills HPC Tutorial Series. Linux Basics I Mills HPC Tutorial Series Linux Basics I Objectives Command Line Window Anatomy Command Structure Command Examples Help Files and Directories Permissions Wildcards and Home (~) Redirection and Pipe Create

More information

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech Unix File System Class Meeting 2 * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech Unix File System The file system is your interface to: physical

More information

INTRODUCTION TO LINUX

INTRODUCTION TO LINUX INTRODUCTION TO LINUX REALLY SHORT HISTORY Before GNU/Linux there were DOS, MAC and UNIX. All systems were proprietary. The GNU project started in the early 80s by Richard Stallman Goal to make a free

More information

Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p.

Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p. Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p. 2 Conventions Used in This Book p. 2 Introduction to UNIX p. 5 An Overview

More information

Unix as a Platform Exercises. Course Code: OS-01-UNXPLAT

Unix as a Platform Exercises. Course Code: OS-01-UNXPLAT Unix as a Platform Exercises Course Code: OS-01-UNXPLAT Working with Unix 1. Use the on-line manual page to determine the option for cat, which causes nonprintable characters to be displayed. Run the command

More information

EECS 2031E. Software Tools Prof. Mokhtar Aboelaze

EECS 2031E. Software Tools Prof. Mokhtar Aboelaze EECS 2031 Software Tools Prof. Mokhtar Aboelaze Footer Text 1 EECS 2031E Instructor: Mokhtar Aboelaze Room 2026 CSEB lastname@cse.yorku.ca x40607 Office hours TTH 12:00-3:00 or by appointment 1 Grading

More information

Perl and R Scripting for Biologists

Perl and R Scripting for Biologists Perl and R Scripting for Biologists Lukas Mueller PLBR 4092 Course overview Linux basics (today) Linux advanced (Aure, next week) Why Linux? Free open source operating system based on UNIX specifications

More information

Basic Linux Command Line Interface Guide

Basic Linux Command Line Interface Guide This basic Linux Command-Line Interface (CLI) Guide provides a general explanation of commonly used Bash shell commands for the Barracuda NG Firewall. You can access the command-line interface by connecting

More information

Lab Working with Linux Command Line

Lab Working with Linux Command Line Introduction In this lab, you will use the Linux command line to manage files and folders and perform some basic administrative tasks. Recommended Equipment A computer with a Linux OS, either installed

More information

Getting your department account

Getting your department account 02/11/2013 11:35 AM Getting your department account The instructions are at Creating a CS account 02/11/2013 11:36 AM Getting help Vijay Adusumalli will be in the CS majors lab in the basement of the Love

More information

Week 2 Lecture 3. Unix

Week 2 Lecture 3. Unix Lecture 3 Unix Terminal and Shell 2 Terminal Prompt Command Argument Result 3 Shell Intro A system program that allows a user to execute: shell functions (e.g., ls -la) other programs (e.g., eclipse) shell

More information

Basic Linux Command Line Interface Guide

Basic Linux Command Line Interface Guide This basic Linux Command-Line Interface (CLI) Guide provides a general explanation of commonly used Bash shell commands for the Barracuda NG Firewall. You can access the command-line interface by connecting

More information

Practical Session 0 Introduction to Linux

Practical Session 0 Introduction to Linux School of Computer Science and Software Engineering Clayton Campus, Monash University CSE2303 and CSE2304 Semester I, 2001 Practical Session 0 Introduction to Linux Novell accounts. Every Monash student

More information

Unix Filesystem. January 26 th, 2004 Class Meeting 2

Unix Filesystem. January 26 th, 2004 Class Meeting 2 Unix Filesystem January 26 th, 2004 Class Meeting 2 * Notes adapted by Christian Allgood from previous work by other members of the CS faculty at Virginia Tech Unix Filesystem! The filesystem is your interface

More information

Filesystem Hierarchy Operating systems I800 Edmund Laugasson

Filesystem Hierarchy Operating systems I800 Edmund Laugasson Filesystem Hierarchy Operating systems I800 Edmund Laugasson edmund.laugasson@itcollege.ee There has been used materials from Margus Ernits, Katrin Loodus when creating current slides. Current document

More information

TEL2821/IS2150: INTRODUCTION TO SECURITY Lab: Operating Systems and Access Control

TEL2821/IS2150: INTRODUCTION TO SECURITY Lab: Operating Systems and Access Control TEL2821/IS2150: INTRODUCTION TO SECURITY Lab: Operating Systems and Access Control Version 1.0, Last Edited 09/20/2005 Name of Students: Date of Experiment: Part I: Objective The objective of the exercises

More information

Getting Started. Running Utilities. Shells. Special Characters. Special Characters. Chapter 2 Unix Utilities for non-programmers

Getting Started. Running Utilities. Shells. Special Characters. Special Characters. Chapter 2 Unix Utilities for non-programmers Chapter 2 Unix Utilities for non-programmers Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman Converted to presentation

More information

Files (review) and Regular Expressions. Todd Kelley CST8207 Todd Kelley 1

Files (review) and Regular Expressions. Todd Kelley CST8207 Todd Kelley 1 Files (review) and Regular Expressions Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 midterms (Feb 11 and April 1) Files and Permissions Regular Expressions 2 Sobel, Chapter 6 160_pathnames.html

More information

Linux Command Line Primer. By: Scott Marshall

Linux Command Line Primer. By: Scott Marshall Linux Command Line Primer By: Scott Marshall Draft: 10/21/2007 Table of Contents Topic Page(s) Preface 1 General Filesystem Background Information 2 General Filesystem Commands 2 Working with Files and

More information

CSCI 2132 Software Development. Lecture 4: Files and Directories

CSCI 2132 Software Development. Lecture 4: Files and Directories CSCI 2132 Software Development Lecture 4: Files and Directories Instructor: Vlado Keselj Faculty of Computer Science Dalhousie University 12-Sep-2018 (4) CSCI 2132 1 Previous Lecture Some hardware concepts

More information

Linux & Shell Programming 2014

Linux & Shell Programming 2014 Unit -1: Introduction to UNIX/LINUX Operating System Practical Practice Questions: Find errors (if any) otherwise write output or interpretation of following commands. (Consider default shell is bash shell.)

More information

Course 144 Supplementary Materials. UNIX Fundamentals

Course 144 Supplementary Materials. UNIX Fundamentals Course 144 Supplementary Materials UNIX Fundamentals 1 Background to UNIX Command Fundamentals This appendix provides a overview of critical commands and concepts Prerequisite knowledge attendees should

More information

File System. yihshih

File System. yihshih File System yihshih Files % ls l d rwx--x--x 7 wutzh gcs 1024 Sep 22 17:25 public_html File type File access mode # of links File user owner File group owner File size File last modify time 2 File name

More information

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80 CSE 303 Lecture 2 Introduction to bash shell read Linux Pocket Guide pp. 37-46, 58-59, 60, 65-70, 71-72, 77-80 slides created by Marty Stepp http://www.cs.washington.edu/303/ 1 Unix file system structure

More information

Introduction to Linux Workshop 1

Introduction to Linux Workshop 1 Introduction to Linux Workshop 1 The George Washington University SEAS Computing Facility Created by Jason Hurlburt, Hadi Mohammadi, Marco Suarez hurlburj@gwu.edu Logging In The lab computers will authenticate

More information

UNIX Quick Reference

UNIX Quick Reference UNIX Quick Reference This card represents a brief summary of some of the more frequently used UNIX commands that all users should be at least somewhat familiar with. Some commands listed have much more

More information

Physics REU Unix Tutorial

Physics REU Unix Tutorial Physics REU Unix Tutorial What is unix? Unix is an operating system. In simple terms, its the set of programs that makes a computer work. It can be broken down into three parts. (1) kernel: The component

More information

Unix File System. Learning command-line navigation of the file system is essential for efficient system usage

Unix File System. Learning command-line navigation of the file system is essential for efficient system usage ULI101 Week 02 Week Overview Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages Text editing Common file utilities: cat,more,less,touch,file,find

More information

Prof. Navrati Saxena TA: R. Sachan

Prof. Navrati Saxena TA: R. Sachan Prof. Navrati Saxena navrati@ece.skku.ac.kr TA: R. Sachan rochak@skku.edu What is UNIX Command What is UNIX Shell Linux file structure UNIX/LINUX Commands 2 A command is a program which interacts with

More information

Operating Systems. Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000) alphapeeler.sf.net/pubkeys/pkey.htm

Operating Systems. Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000) alphapeeler.sf.net/pubkeys/pkey.htm Operating Systems Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000) armahmood786@yahoo.com alphasecure@gmail.com alphapeeler.sf.net/pubkeys/pkey.htm http://alphapeeler.sourceforge.net pk.linkedin.com/in/armahmood

More information

Operating Systems. Copyleft 2005, Binnur Kurt

Operating Systems. Copyleft 2005, Binnur Kurt 3 Operating Systems Copyleft 2005, Binnur Kurt Content The concept of an operating system. The internal architecture of an operating system. The architecture of the Linux operating system in more detail.

More information

Week Overview. Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages

Week Overview. Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages ULI101 Week 02 Week Overview Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages Text editing Common file utilities: cat,more,less,touch,file,find

More information

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing Content 3 Operating Systems The concept of an operating system. The internal architecture of an operating system. The architecture of the Linux operating system in more detail. How to log into (and out

More information

bash, part 3 Chris GauthierDickey

bash, part 3 Chris GauthierDickey bash, part 3 Chris GauthierDickey More redirection As you know, by default we have 3 standard streams: input, output, error How do we redirect more than one stream? This requires an introduction to file

More information

12.1 UNDERSTANDING UNIX SHELL PROGRAMMING LANGUAGE: AN INTRODUCTION Writing a Simple Script Executing a Script

12.1 UNDERSTANDING UNIX SHELL PROGRAMMING LANGUAGE: AN INTRODUCTION Writing a Simple Script Executing a Script 12 Shell Programming This chapter concentrates on shell programming. It explains the capabilities of the shell as an interpretive high-level language. It describes shell programming constructs and particulars.

More information

Introduction of Linux

Introduction of Linux Introduction of Linux 阳 oslab2018_class1@163.com 寅 oslab2018_class2@163.com PART I Brief Introduction Basic Conceptions & Environment Install & Configure a Virtual Machine Basic Commands PART II Shell

More information

INSE Lab 1 Introduction to UNIX Fall 2017

INSE Lab 1 Introduction to UNIX Fall 2017 INSE 6130 - Lab 1 Introduction to UNIX Fall 2017 Updated by: Paria Shirani Overview In this lab session, students will learn the basics of UNIX /Linux commands. They will be able to perform the basic operations:

More information

CHAPTER 1 UNIX FOR NONPROGRAMMERS

CHAPTER 1 UNIX FOR NONPROGRAMMERS CHAPTER 1 UNIX FOR NONPROGRAMMERS The man command is used to display the manual entry associated with word entered as argument. The -k option is used displays a list of manual entries that contain entered

More information

Some useful UNIX Commands written down by Razor for newbies to get a start in UNIX

Some useful UNIX Commands written down by Razor for newbies to get a start in UNIX Some useful UNIX Commands written down by Razor for newbies to get a start in UNIX 15th Jan. 2000 / 3:55 am Part 1: Working with files and rights ------------------------------------- cp

More information

2) clear :- It clears the terminal screen. Syntax :- clear

2) clear :- It clears the terminal screen. Syntax :- clear 1) cal :- Displays a calendar Syntax:- cal [options] [ month ] [year] cal displays a simple calendar. If arguments are not specified, the current month is displayed. In addition to cal, the ncal command

More information

Read the relevant material in Sobell! If you want to follow along with the examples that follow, and you do, open a Linux terminal.

Read the relevant material in Sobell! If you want to follow along with the examples that follow, and you do, open a Linux terminal. Warnings 1 First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion. Read the relevant material in Sobell! If

More information

Answers to Even- Numbered Exercises

Answers to Even- Numbered Exercises Answers to Even- 17 Numbered Exercises from page 1077 1. What option should you use with fsck if you want to review the status of your filesystems without making any changes to them? How does fsck determine

More information

LAB #7 Linux Tutorial

LAB #7 Linux Tutorial Gathering information: LAB #7 Linux Tutorial Find the password file on a Linux box Scenario You have access to a Linux computer. You must find the password file on the computer. Objective Get a listing

More information

Introduction to UNIX Shell Exercises

Introduction to UNIX Shell Exercises Introduction to UNIX Shell Exercises Determining Your Shell Open a new window or use an existing window for this exercise. Observe your shell prompt - is it a $ or %? What does this tell you? Find out

More information

CST8207: GNU/Linux Operating Systems I Lab Six Linux File System Permissions. Linux File System Permissions (modes) - Part 1

CST8207: GNU/Linux Operating Systems I Lab Six Linux File System Permissions. Linux File System Permissions (modes) - Part 1 Student Name: Lab Section: Linux File System Permissions (modes) - Part 1 Due Date - Upload to Blackboard by 8:30am Monday March 12, 2012 Submit the completed lab to Blackboard following the Rules for

More information

Introduction to Linux Part I: The Filesystem Luca Heltai

Introduction to Linux Part I: The Filesystem Luca Heltai The 2nd workshop on High Performance Computing Introduction to Linux Part I: The Filesystem Luca Heltai SISSA/eLAB - Trieste Adapted from a presentation by Michael Opdenacker Free Electrons http://free-electrons.com

More information

Introduction to Linux

Introduction to Linux p. 1/40 Introduction to Linux Xiaoxu Guan High Performance Computing, LSU January 31, 2018 p. 2/40 Outline What is an OS or Linux OS? Basic commands for files/directories Basic commands for text processing

More information

A Brief Introduction to Unix

A Brief Introduction to Unix A Brief Introduction to Unix Sean Barag Drexel University March 30, 2011 Sean Barag (Drexel University) CS 265 - A Brief Introduction to Unix March 30, 2011 1 / 17 Outline 1 Directories

More information

Introduction to Linux. Fundamentals of Computer Science

Introduction to Linux. Fundamentals of Computer Science Introduction to Linux Fundamentals of Computer Science Outline Operating Systems Linux History Linux Architecture Logging in to Linux Command Format Linux Filesystem Directory and File Commands Wildcard

More information

commandname flags arguments

commandname flags arguments Unix Review, additional Unix commands CS101, Mock Introduction This handout/lecture reviews some basic UNIX commands that you should know how to use. A more detailed description of this and other commands

More information

d. Permissions 600 on directory dir and 300 on file dir/foo. c. Permissions 700 on directory dir and 200 on file dir/foo.

d. Permissions 600 on directory dir and 300 on file dir/foo. c. Permissions 700 on directory dir and 200 on file dir/foo. Ian! D. Allen Winter 2012-1- 45 minutes Test Version: Print Name: Multiple Choice - 42 Questions - 25 of 25% 1. Read all the instructions and both sides (back and front) of all pages. 2. Put the Test Version

More information

Introduction to remote command line Linux. Research Computing Team University of Birmingham

Introduction to remote command line Linux. Research Computing Team University of Birmingham Introduction to remote command line Linux Research Computing Team University of Birmingham Linux/UNIX/BSD/OSX/what? v All different v UNIX is the oldest, mostly now commercial only in large environments

More information

Unix Basics. UNIX Introduction. Lecture 14

Unix Basics. UNIX Introduction. Lecture 14 Unix Basics Lecture 14 UNIX Introduction The UNIX operating system is made up of three parts; the kernel, the shell and the programs. The kernel of UNIX is the hub of the operating system: it allocates

More information

UNIX System Administration

UNIX System Administration $!... 14:13 $$... 14:13.netrc...12:27-28 /etc/fstab... 6:25 /etc/hosts.equiv... 8:23 /etc/inittab Entries... 4:8 /etc/netmasks... 8:22 /etc/shells... 12:25 /home... 6:69 /tmp...6:61-67 /usr... 6:70 /var...

More information

*nix Crash Course. Presented by: Virginia Tech Linux / Unix Users Group VTLUUG

*nix Crash Course. Presented by: Virginia Tech Linux / Unix Users Group VTLUUG *nix Crash Course Presented by: Virginia Tech Linux / Unix Users Group VTLUUG Ubuntu LiveCD No information on your hard-drive will be modified. Gives you a working Linux system without having to install

More information

Introduction to Unix: Fundamental Commands

Introduction to Unix: Fundamental Commands Introduction to Unix: Fundamental Commands Ricky Patterson UVA Library Based on slides from Turgut Yilmaz Istanbul Teknik University 1 What We Will Learn The fundamental commands of the Unix operating

More information

Operating Systems Lab 1 (Users, Groups, and Security)

Operating Systems Lab 1 (Users, Groups, and Security) Operating Systems Lab 1 (Users, Groups, and Security) Overview This chapter covers the most common commands related to users, groups, and security. It will also discuss topics like account creation/deletion,

More information

Crash Course in Unix. For more info check out the Unix man pages -orhttp://www.cs.rpi.edu/~hollingd/unix. -or- Unix in a Nutshell (an O Reilly book).

Crash Course in Unix. For more info check out the Unix man pages -orhttp://www.cs.rpi.edu/~hollingd/unix. -or- Unix in a Nutshell (an O Reilly book). Crash Course in Unix For more info check out the Unix man pages -orhttp://www.cs.rpi.edu/~hollingd/unix -or- Unix in a Nutshell (an O Reilly book). 1 Unix Accounts To access a Unix system you need to have

More information

Computer Systems and Architecture

Computer Systems and Architecture Computer Systems and Architecture Introduction to UNIX Stephen Pauwels University of Antwerp October 2, 2015 Outline What is Unix? Getting started Streams Exercises UNIX Operating system Servers, desktops,

More information

Linux Systems Administration Getting Started with Linux

Linux Systems Administration Getting Started with Linux Linux Systems Administration Getting Started with Linux Network Startup Resource Center www.nsrc.org These materials are licensed under the Creative Commons Attribution-NonCommercial 4.0 International

More information

Standard. Shells. tcsh. A shell script is a file that contains shell commands that perform a useful function. It is also known as shell program.

Standard. Shells. tcsh. A shell script is a file that contains shell commands that perform a useful function. It is also known as shell program. SHELLS: The shell is the part of the UNIX that is most visible to the user. It receives and interprets the commands entered by the user. In many respects, this makes it the most important component of

More information

UNIX COMMANDS AND SHELLS. UNIX Programming 2015 Fall by Euiseong Seo

UNIX COMMANDS AND SHELLS. UNIX Programming 2015 Fall by Euiseong Seo UNIX COMMANDS AND SHELLS UNIX Programming 2015 Fall by Euiseong Seo What is a Shell? A system program that allows a user to execute Shell functions (internal commands) Other programs (external commands)

More information

Linux Command Line Interface. December 27, 2017

Linux Command Line Interface. December 27, 2017 Linux Command Line Interface December 27, 2017 Foreword It is supposed to be a refresher (?!) If you are familiar with UNIX/Linux/MacOS X CLI, this is going to be boring... I will not talk about editors

More information

Overview of the UNIX File System

Overview of the UNIX File System Overview of the UNIX File System Navigating and Viewing Directories Adapted from Practical Unix and Programming Hunter College Copyright 2006 Stewart Weiss The UNIX file system The most distinguishing

More information

Hands-on Keyboard: Cyber Experiments for Strategists and Policy Makers

Hands-on Keyboard: Cyber Experiments for Strategists and Policy Makers Hands-on Keyboard: Cyber Experiments for Strategists and Policy Makers Review of the Linux File System and Linux Commands 1. Introduction Becoming adept at using the Linux OS requires gaining familiarity

More information