INSTITUTE OF AGA LINUX LPI 5TH STAGE LECTURER: NIYAZ M. SALIH

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

Download "INSTITUTE OF AGA LINUX LPI 5TH STAGE LECTURER: NIYAZ M. SALIH"

Transcription

1 INSTITUTE OF AGA LINUX LPI 5TH STAGE LECTURER: NIYAZ M. SALIH

2 Chapter 1. Operating System Operating System: An Operating System, or OS, is low-level software that enables a user and higher-level application software to interact with a computer s hardware and the data and other programs stored on the computer. The main functions of operating systems are: -Program creation -Program execution -Input/Output operations -Error detection Institute of Aga Linux LPI Niyaz M. Salih (1)

3 Characteristics of Linux Multi-user A multi-user operating system allows for multiple users to use the same computer at the same time and/or different times. Multiprocessing An operating system capable of supporting and utilizing more than one computer processor. Multitasking An operating system that is capable of allowing multiple software processes to run at the same time. Multithreading Operating systems that allow different parts of a software program to run concurrently. Linux: Open source code OS and it is freely available to everyone. GUI operating system, including many of the tools that Windows users are familiar with such as, -A file manager -A Window manager -A help system -A configuration. Open source means any developer can customize code to create Linux OS. Institute of Aga Linux LPI Niyaz M. Salih (2)

4 Distribution packages Since Linux is open source. Lots of communities and companies made specific Operating system by using Linux. These specific operating systems are known as distribution of Linux. Some of them are free (community developed) and few are paid also. Following are few popular Linux distributions: -CentOS -Fedora -Suse Linux -Ubuntu -Red Hat Enterprise Linux Ubuntu Distribution Ubuntu is an ancient African word meaning humanity to others. It also means I am what I am because of who we all are. The Ubuntu operating system brings the spirit of Ubuntu to the world of computers. Institute of Aga Linux LPI Niyaz M. Salih (3)

5 Ubuntu desktop operating system powers millions of PCs and laptops around the world. Complete Open source Secure Accessible Complete Ubuntu comes with everything you need to run your organization, school, home or enterprise. All the essential applications, like an office suite, browsers, and media apps come pre-installed and thousands more games and applications are available in the Ubuntu Software Centre Open Source Ubuntu has always been free to download, use and share. We believe in the power of open source software; Ubuntu could not exist without its worldwide community of voluntary developers. Secure With a built-in firewall and virus protection software, Ubuntu is one of the most secure operating systems around. And the long-term support releases give you five years of security patches and updates. Accessible Computing is for everyone regardless of nationality, gender or disability. Ubuntu is fully translated into over 50 languages and includes essential assistive technologies. Institute of Aga Linux LPI Niyaz M. Salih (4)

6 Chapter 2. Linux Distribution & Architecture Linux Distribution RED HAT LINUX One of the original Linux distribution. The commercial, non-free version is Red Hat Enterprise Linux, which is aimed at big companies using Linux servers and desktops in a big way Free version: Fedora Project DEBIAN GNU/LINUX A free software distribution. Popular for use on servers. However, Debian is not what many would consider a distribution for beginners, as it's not designed with ease of use in mind. Institute of Aga Linux LPI Niyaz M. Salih (5)

7 GENTOO LINUX Gentoo is a specialty distribution meant for programmers. SUSE LINUX SUSE was recently purchased by Novell. This distribution is primarily available for pay because it contains many commercial programs, although there's a stripped-down free version that you can download. MANDRAKE LINUX Mandrake is perhaps strongest on the desktop, originally based off of Red Hat Linux. LINUX SYSTEM ARCHITECTURE Institute of Aga Linux LPI Niyaz M. Salih (6)

8 Linux System Architecture is consists of following layers: Hardware layer - Hardware consists of all peripheral devices (RAM/ HDD/ CPU etc). Kernel - Core component of Operating System, interacts directly with hardware, provides low level services to upper layer components. Shell - An interface to kernel, hiding complexity of kernel's functions from users. Utilities - Utility programs giving user most of the functionalities of an operating systems. Institute of Aga Linux LPI Niyaz M. Salih (7)

9 Chapter 3. Linux Terminology Linux Terminology Kernel Distribution Boot Loader Service File System X Window System Desktop Environment Command Line Kernel The kernel is considered the brain of the Linux OS. It controls the hardware and makes the hardware interact with the application. Institute of Aga Linux LPI Niyaz M. Salih (8)

10 Distribution A distribution also known as Distros is a collection of programs combined with the Linux kernel to make up a Linux-based OS Bootloader Bootloader are used to boot other operating systems, usually each operating system has a set of bootloaders specific for it. Bootloaders usually contain several ways to boot the OS kernel and also contain commands for debugging and/or modifying the kernel environment. Service A service is a program that runs as a Background process. File system A file system is a method for storing and organizing files in Linux. Some examples of file systems are ext3,ext4,fat,xfs and Btrfs. X Windows System The X Windows System provides the standard toolkit and protocol to build graphical user interfaces on nearly all Linux systems. Institute of Aga Linux LPI Niyaz M. Salih (9)

11 Desktop environment The desktop environment is a graphical interface on top of the OS GNOME, KDE, Xfce and Fluxbox Command line Command line is an interface for typing commands on top the OS Institute of Aga Linux LPI Niyaz M. Salih (10)

12 Chapter 4. Man Pages man $command Type man followed by a command (for which you want help) and start reading. Press q to quit the manpage. Some man pages contain examples (near the end). man $configfile Most configuration files have their own manual. man $daemon This is also true for most daemons (background programs) on your system.. Institute of Aga Linux LPI Niyaz M. Salih (11)

13 man -k (apropos) man -k (or apropos) shows a list of man pages containing a string. whatis To see just the description of a manual page, use whatis followed by a string. whereis The location of a manpage can be revealed with whereis. Institute of Aga Linux LPI Niyaz M. Salih (12)

14 man sections By now you will have noticed the numbers between the round brackets. man man will explain to you that these are section numbers. Executable programs and shell commands reside in section one. 1 User Commands Programs and applications useful to the average user. There is usually one entry for each command and/or group of related commands. 2 System Calls Programming interfaces to the operating system itself. These are C calls that control the allocation and use of system resources. 3 Libraries Programming subroutines. Every C library function from standards like printf through the most obscure X Windows call belongs here. If other languages are installed. 4 Devices and Special Files System resources such as memory, hard disks, graphics displays, etc., are referred to as devices. 5 File Formats This section primarily describes the formats of operating system related files. Formats for application data files. 6 Games Manual pages for most games, demonstrations, and other "non-productive" programs are usually listed here. 7 Miscellaneous A few random bits that don't go anywhere else. Mostly text processing macro sets. 8 System Administration These pages describe all of the various programs, utilities, daemons, and a few of the concepts that make the system run. Institute of Aga Linux LPI Niyaz M. Salih (13)

15 man $section $file Therefore, when referring to the man page of the passwd command, you will see it written as passwd(1); when referring to the passwd file, you will see it written as passwd(5). The screenshot explains how to open the man page in the correct section. man man If you want to know more about man, then Read The Fantastic Manual (RTFM). Unfortunately, manual pages do not have the answer to everything... mandb Should you be convinced that a man page exists, but you can't access it, then try running mandb on Debian/Mint. Institute of Aga Linux LPI Niyaz M. Salih (14)

16 Chapter 5. Working with directories pwd Then you are here sign can be displayed with the pwd command (Print Working Directory). Go ahead, try it: Open a command line interface (also called a terminal, console) and type pwd. The tool displays your current directory. cd You can change your current directory with the cd command (Change Directory). cd ~ The cd is also a shortcut to get back into your home directory. Just typing cd without a target directory, will put you in your home directory. Typing cd ~ has the same effect. cd.. To go to the parent directory (the one just above your current directory in the directory tree), type cd... Institute of Aga Linux LPI Niyaz M. Salih (15)

17 cd - Another useful shortcut with cd is to just type cd - to go to the previous directory. Absolute and relative paths You should be aware of absolute and relative paths in the file tree. When you type a path starting with a slash (/), then the root of the file tree is assumed. If you don't start your path with a slash, then the current directory is the assumed starting point. The screenshot below first shows the current directory /home/serverme. From within this directory, you have to type cd /home instead of cd home to go to the /home directory. When inside /home, you have to type cd serverme instead of cd /serverme to enter the subdirectory serverme of the current directory /home. Institute of Aga Linux LPI Niyaz M. Salih (16)

18 In case your current directory is the root directory /, then both cd /home and cd home will get you in the /home directory. Path completion The tab key can help you in typing a path without errors. Typing cd /et followed by the tab key will expand the command line to cd /etc/. When typing cd /Et followed by the tab key, nothing will happen because you typed the wrong path (upper case E). You will need fewer key strokes when using the tab key, and you will be sure your typed path is correct! ls You can list the contents of a directory with ls. ls -a A frequently used option with ls is -a to show all files. Showing all files means including the hidden files. When a file name on a Linux file system starts with a dot, it is considered a hidden file and it doesn't show up in regular file listings. Institute of Aga Linux LPI Niyaz M. Salih (17)

19 ls -l Many times you will be using options with ls to display the contents of the directory in different formats or to display different parts of the directory. Typing just ls gives you a list of files in the directory. Typing ls -l (that is a letter L, not the number 1) gives you a long listing. ls -lh Another frequently used ls option is -h. It shows the numbers (file sizes) in a more human readable format. Also shown below is some variation in the way you can give the options to ls. We will explain the details of the output later in this book. Note that we use the letter L as an option in this screenshot, not the number 1. Institute of Aga Linux LPI Niyaz M. Salih (18)

20 mkdir Walking around the Unix file tree is fun, but it is even more fun to create your own directories with mkdir. You have to give at least one parameter to mkdir, the name of the new directory to be created. Think before you type a leading /. mkdir -p The following command will fail, because the parent directory of threedirsdeep does not exist. rmdir When a directory is empty, you can use rmdir to remove the directory. Institute of Aga Linux LPI Niyaz M. Salih (19)

21 rmdir -p And similar to the mkdir -p option, you can also use rmdir to recursively remove directorie s. Institute of Aga Linux LPI Niyaz M. Salih (20)

22 Chapter 6. Working with files All files are case sensitive Files on Linux (or any Unix) are case sensitive. This means that FILE1 is different from file1, and /etc/hosts is different from /etc/hosts (the latter one does not exist on a typical Linux computer). This screenshot shows the difference between two files, one with upper case W, the other with lower case w. Everything is a file A directory is a special kind of file, but it is still a (case sensitive!) file. Each terminal window (for example /dev/pts/4), any hard disk or partition (for example /dev/sdb1) and any process are all represented somewhere in the file system as a file. It will become clear throughout this course that everything on Linux is a file. file The file utility determines the file type. Linux does not use extensions to determine the file type. The command line does not care whether a file ends in.txt or.pdf. As a system administrator, you should use the file command to determine the file type. Here are some examples on a typical Linux system. Institute of Aga Linux LPI Niyaz M. Salih (21)

23 The file command uses a magic file that contains patterns to recognise file types. The magic file is located in /usr/share/file/magic. Type man 5 magic for more information. It is interesting to point out file -s for special files like those in /dev and /proc. touch Create an empty file One easy way to create an empty file is with touch. (We will see many other ways for creating files later in this book.) This screenshot starts with an empty directory, creates two files with touch and the lists those files. Institute of Aga Linux LPI Niyaz M. Salih (22)

24 touch -t The touch command can set some properties while creating empty files. Can you determine what is set by looking at the next screenshot? If not, check the manual for touch. rm remove forever When you no longer need a file, use rm to remove it. Unlike some graphical user interfaces, the command line in general does not have a waste bin or trash can to recover files. When you use rm to remove a file, the file is gone. Therefore, be careful when removing files! Institute of Aga Linux LPI Niyaz M. Salih (23)

25 rm -i To prevent yourself from accidentally removing a file, you can type rm -i. rm -rf By default, rm -r will not remove non-empty directories. However rm accepts several options that will allow you to remove any directory. The rm -rf statement is famous because it will erase anything (providing that you have the permissions to do so). When you are logged on as root, be very careful with rm -rf (the f means force and the r means recursive) since being root implies that permissions don't apply to you. You can literally erase your entire file system by accident. Institute of Aga Linux LPI Niyaz M. Salih (24)

26 cp Copy one file To copy a file, use cp with a source and a target argument. Copy to another directory If the target is a directory, then the source files are copied to that target directory. cp -r To copy complete directories, use cp -r (the -r option forces recursive copying of all files in all subdirectories). Institute of Aga Linux LPI Niyaz M. Salih (25)

27 Copy multiple files to directory You can also use cp to copy multiple files into a directory. In this case, the last argument (a.k.a. the target) must be a directory. cp -i To prevent cp from overwriting existing files, use the -i (for interactive) option. mv Rename files with mv Use mv to rename a file or to move the file to another directory. When you need to rename only one file then mv is the preferred command to use. Institute of Aga Linux LPI Niyaz M. Salih (26)

28 Rename directories with mv The same mv command can be used to rename directories. mv -i The mv also has a -i switch similar to cp and rm. this screenshot shows that mv -i will ask permission to overwrite an existing file. Institute of Aga Linux LPI Niyaz M. Salih (27)

29 Chapter 7. working with file contents head You can use head to display the first ten lines of a file. The head command can also display the first n lines of a file. And head can also display the first n bytes. Institute of Aga Linux LPI Niyaz M. Salih (28)

30 tail Similar to head, the tail command will display the last ten lines of a file. You can give tail the number of lines you want to see. cat The cat command is one of the most universal tools, yet all it does is copy standard input to standard output. In combination with the shell this can be very powerful and diverse. Some examples will give a glimpse into the possibilities. The first example is simple, you can use cat to display a file on the screen. If the file is longer than the screen, it will scroll to the end. Institute of Aga Linux LPI Niyaz M. Salih (29)

31 Concatenate cat is short for concatenate. One of the basic uses of cat is to concatenate files into a bigger (or complete) file. Create files You can use cat to create flat text files. Type the cat > winter.txt command as shown in the screenshot below. Then type one or more lines, finishing each line with the enter key. After the last line, type and hold the Control (Ctrl) key and press d. Institute of Aga Linux LPI Niyaz M. Salih (30)

32 The Ctrl d key combination will send an EOF (End of File) to the running process ending the cat command. Custom end marker You can choose an end marker for cat with << as is shown in this screenshot. This construction is called a here directive and will end the cat command. Copy files In the third example you will see that cat can be used to copy files. We will explain in detail what happens here in the bash shell chapter. tac Just one example will show you the purpose of tac (cat backwards). Institute of Aga Linux LPI Niyaz M. Salih (31)

33 Chapter 8. The Linux file tree File system hierarchy standard Many Linux distributions partially follow the Filesystem Hierarchy Standard. The FHS may help make more Unix/Linux file system trees conform better in the future. The FHS is available online at where we read: "The filesystem hierarchy standard has been designed to be used by Unix distribution developers, package developers, and system implementers. However, it is primarily intended to be a reference and is not a tutorial on how to manage a Unix filesystem or directory hierarchy." man hier There are some differences in the filesystems between Linux distributions. For help about your machine, enter man hier to find information about the file system hierarchy. This manual will explain the directory structure on your computer. Institute of Aga Linux LPI Niyaz M. Salih (32)

34 The root directory / All Linux systems have a directory structure that starts at the root directory. The root directory is represented by a forward slash, like this: /. Everything that exists on your Linux system can be found below this root directory. Let's take a brief look at the contents of the root directory. Binary directories Binaries are files that contain compiled source code (or machine code). Binaries can be executed on the computer. Sometimes binaries are called executables. /bin The /bin directory contains binaries for use by all users. According to the FHS the /bin directory should contain /bin/cat and /bin/date (among others). In the screenshot below you see common Unix/Linux commands like cat, cp, cpio, date, dd, echo, grep, and so on. Many of these will be covered in this book. Other /bin directories You can find a /bin subdirectory in many other directories. A user named serena could put her own programs in /home/serena/bin. Institute of Aga Linux LPI Niyaz M. Salih (33)

35 Some applications, often when installed directly from source will put themselves in /opt. A samba server installation can use /opt/samba/bin to store its binaries. /sbin /sbin contains binaries to configure the operating system. Many of the system binaries require root privilege to perform certain tasks. Below a screenshot containing system binaries to change the ip address, partition a disk and create an ext4 file system. /lib Binaries found in /bin and /sbin often use shared libraries located in /lib. Below is a screenshot of the partial contents of /lib. /lib/modules Typically, the Linux kernel loads kernel modules from /lib/modules/$kernel-version/. This directory is discussed in detail in the Linux kernel chapter. Institute of Aga Linux LPI Niyaz M. Salih (34)

36 /lib32 and /lib64 We currently are in a transition between 32-bit and 64-bit systems. Therefore, you may encounter directories named /lib32 and /lib64 which clarify the register size used during compilation time of the libraries. A 64- bit computer may have some 32-bit binaries and libraries for compatibility with legacy applications. This screenshot uses the file utility to demonstrate the difference. The ELF (Executable and Linkable Format) is used in almost every Unix-like operating system since System V. /opt The purpose of /opt is to store optional software. In many cases this is software from outside the distribution repository. You may find an empty /opt directory on many systems. A large package can install all its files in /bin, /lib, /etc subdirectories within /opt/$packagename/. If for example the package is called wp, then it installs in /opt/wp, putting binaries in /opt/wp/bin and manpages in /opt/wp/man. Institute of Aga Linux LPI Niyaz M. Salih (35)

37 Configuration directories /boot The /boot directory contains all files needed to boot the computer. These files don't change very often. On Linux systems you typically find the /boot/grub directory here. /boot/grub contains /boot/grub/grub.cfg (older systems may still have /boot/grub/grub.conf) which defines the boot menu that is displayed before the kernel starts. /etc All of the machine-specific configuration files should be located in /etc. Historically /etc stood for etcetera, today people often use the Editable Text Configuration backronym. Many times the name of a configuration files is the same as the application, daemon, or protocol with.conf added as the extension. Data directories /home Users can store personal or project data under /home. It is common (but not mandatory by the fhs) practice to name the users home directory after the user name in the format /home/$username. For example: Institute of Aga Linux LPI Niyaz M. Salih (36)

38 Besides giving every user (or every project or group) a location to store personal files, the home directory of a user also serves as a location to store the user profile. A typical Unix user profile contains many hidden files (files whose file name starts with a dot). The hidden files of the Unix user profiles contain settings specific for that user. /root On many systems /root is the default location for personal data and profile of the root user. If it does not exist by default, then some administrators create it. /srv You may use /srv for data that is served by your system. The FHS allows locating cvs, rsync, ftp and www data in this location. The FHS also approves administrative naming in /srv, like /srv/project55/ftp and /srv/sales/www. On Sun Solaris (or Oracle Solaris) /export is used for this purpose. /media The /media directory serves as a mount point for removable media devices such as CD-ROM's, digital cameras, and various usb-attached devices. Since /media is rather new in the Unix world, you could very well encounter systems running without this directory. Solaris 9 does not have it, Solaris 10 does. Most Linux distributions today mount all removable media in /media. Institute of Aga Linux LPI Niyaz M. Salih (37)

39 /mnt The /mnt directory should be empty and should only be used for temporary mount points (according to the FHS). Unix and Linux administrators used to create many directories here, like /mnt/something/. You likely will encounter many systems with more than one directory created and/or mounted inside /mnt to be used for various local and remote filesystems. /tmp Applications and users should use /tmp to store temporary data when needed. Data stored in /tmp may use either disk space or RAM. Both of which are managed by the operating system. Never use /tmp to store data that is important or which you wish to archive. In memory directories /dev Device files in /dev appear to be ordinary files, but are not actually located on the hard disk. The /dev directory is populated with files as the kernel is recognising hardware. Common physical devices Common hardware such as hard disk devices are represented by device files in /dev. below a screenshot of SATA device files on a laptop and then IDE attached drives on a desktop. (The detailed meaning of these devices will be discussed later.) Institute of Aga Linux LPI Niyaz M. Salih (38)

40 Chapter 9: Network Configuration Ifconfig ifconfig (interface configurator) command is use to initialize an interface, assign IP Address to interface and enable or disable interface on demand. With this command you can view IP Address and Hardware / MAC address assign to interface and also MTU (Maximum transmission unit) size. ifconfig with interface (eth0) command only shows specific interface details like IP Address, MAC Address etc. with -a options will display all available interface details if it is disable also. Institute of Aga Linux LPI Niyaz M. Salih (39)

41 Configure with static IP address To configuration network need to open /etc/network/interfaces interface configuration file. Press Ctrl+X then press Y and press Enter To enable or disable specific Interface, we use example command as follows. Institute of Aga Linux LPI Niyaz M. Salih (40)

42 Disable Ethernet Ifdown Enable Ethernet Ifup Route route command also shows and manipulate ip routing table. To see default routing table in Linux, type the following command. Institute of Aga Linux LPI Niyaz M. Salih (41)

43 Ping PING (Packet Internet Groper) command is the best way to test connectivity between two nodes. Whether it is Local Area Network (LAN) or Wide Area Network (WAN). Ping use ICMP (Internet Control Message Protocol) to communicate to other devices. You can ping host name of ip address using below command. Institute of Aga Linux LPI Niyaz M. Salih (42)

44 Configure with Dynamic IP To configuration network need to open /etc/network/interfaces interface configuration file. Press Ctrl+X then press Y and press Enter Disable Ethernet Enable Ethernet Institute of Aga Linux LPI Niyaz M. Salih (43)

45 Chapter 10: Disk Management and Partitions Fdisk(fixed disk or format disk) is a text-based command-line utility for viewing and managing hard disk partitions on Linux. Using fdisk you can view, create, resize, delete, change, copy and move partitions. Fdisk allows you to create a maximum of four primary partitions as permitted by Linux with each requiring a minimum size of 40mb. You can also have a much larger number of logical partitions by subdividing a primary partition. In this article, let us review how to use fdisk command to manage disk partitions by employing some very simple and practical examples. Important points to note 1. Fdisk requires root to operate. On Debian and Ubuntu based systems, you can prefix with sudo. On other distros, use sucommand to get a root shell and then enter the commands without sudo. 2. Take note of the form the device names (disks) are presented. Usually you see following names /dev/hd[a-h] for IDE disks /dev/sd[a-p] for SCSI disks /dev/ed[a-d] for ESDI disks /dev/xd[ab] for XT disks 3. Warning: Do not delete, modify, or add partition unless you know exactly what you are about. You ran the risk of losing your data! Institute of Aga Linux LPI Niyaz M. Salih (44)

46 View All Existing Disk Partitions The first thing you want to do before tampering with your disks and partition is to view basic details about all available partition in the system. The commands list the partitions on your system. When you have more than one disk available, the partitions list are ordered by the device s /dev name as in /dev/sda, /dev/sdb and so on. Use the following command to view all existing partitions in the system View Partition on a Specific Disk If you want to look at all the partitions on a specific disk, use the following command to view all disk partitions on device /dev/sda. Institute of Aga Linux LPI Niyaz M. Salih (45)

47 View all fdisk Commands You can use the following command to view all available fdisk This will provide you with a prompt. Enter m to see the list of all available commands of fdisk which can be operated on /dev/sda. The output will be this Institute of Aga Linux LPI Niyaz M. Salih (46)

48 Delete a Hard Disk Partition Assuming you need to combine some partitions to form a larger one, you will first have to delete those partitions. To delete a specific partition on /dev/sda2, follow the following - 1. Enter the following command to enter/view the disk 2. Enter d to delete a partition. 3. You will be prompted to enter the partition number. We enter 2 in our case to delete /dev/sda2. Save changes by entering w at command and reboot for changes. Create a New Disk Partition with Specific Size To create a new partition, enter the following command 1. Enter the following command to enter/view the disk 2. Enter n to create a new partition which will prompt you to specify for either a primary partition or an extended partition. Enter p for a primary partition or e for an extended partition. Institute of Aga Linux LPI Niyaz M. Salih (47)

49 3. You will then be prompted to enter the first cylinder or sector number of the partition to be created. You may press Enter to accept the defaults. 4. You will then be prompted to enter the Last cylinder or sector number of the partition to be created. You may press Enter to use all available space after the first sector or enter a specific size such as +2G or +256M for a 2 gigabyte or 256 megabyte partition respectively. 5. Run w command to write the changes and reboot your system. How to Format a Partition? After you have created your partition, you need to format it with a file system. Use the following command to format to ext4 file format How to View the Size of your new or existing Partition? If you want to check the size of a specific partitions, use the following command to check the size of partition on /dev/sda2. Viewing the Partition Table You can use the following command to look at your current partition table - Use p in command mode. Institute of Aga Linux LPI Niyaz M. Salih (48)

50 Chapter 11: File System Administration In UNIX several commands are available for file system managements. Before you start practice of creating and deleting partition it is better to do some practice with these commands. df This is handy command to check available free space. Run df command If you feel difficulty in understanding the blocks use -h switch with du command Institute of Aga Linux LPI Niyaz M. Salih (49)

51 du This is useful command to check the size of file. While df commands show the available space in partitions, du commands show the size of files in partitions. You could use df command to check the space used by each partitions. If you need more detail about any specific partition like which file is consuming more space then you could use du command. For example we would like to know how much space is used by /boot partition? How much space is available in /boot partition? What is the size of each files and directories in /boot partition? To get the answer of these questions we would first execute df command with -h switch. It would give us the answer of first and second question. To know the answer of third question use du command with -h switch. You may get confuse from output. As df commands show boot partition is using 27 MB while du command is showing that /boot is using 21 MB so where is remaining 6 MB space?. This space is used by hidden files. You could use du command with -a switch to show the hidden files. Institute of Aga Linux LPI Niyaz M. Salih (50)

52 When you install Linux, the installation program configures the file /etc/fstab to specify what filesystems are to be mounted when the system is started. Here's a typical /etc/fstab file: The first three lines, those beginning with a hash mark (#), are comments that are ignored by the system; they merely help human readers identify and understand the file. The next three lines each specify a filesystem to be mounted at system startup. Six columns of information appear: Filesystem The device that contains the filesystem. Mount point The system directory that will hold the filesystem. Filesystem type Specifies the type of the filesystem. Popular types include: ext2 the standard Linux filesystem. swap Institute of Aga Linux LPI Niyaz M. Salih (51)

53 the standard Linux swap filesystem proc a special filesystem provided by the kernel, used by system components to obtain system information in a standard way iso9660 the standard filesystem used on CD-ROM msdos the standard MS-DOS filesystem See the man page for mount for other filesystem types. Mount options Specifies the options given when the filesystem is mounted. If multiple options are given, each is separated from the next by a comma (,); no spaces appear within the list of options. Popular options include: defaults Specifies a series of options appropriate for most filesystems. For details, see the man page for mount. errors=remount-ro Specifies that if errors are found when the filesystem is checked, the filesystem will be remounted in read-only mode so that the system administrator can analyze the errors without risking further damage. sw Specifies that the filesystem will be mounted as a swap partition. ro Institute of Aga Linux LPI Niyaz M. Salih (52)

54 Specifies that the filesystem will be mounted for read access only. This option is always specified for CD-ROM devices and may be specified for other devices. noauto Specifies that the filesystem will not be automatically mounted at system startup. In addition, the user option can be specified. This option allows any user - not only root - to mount the filesystem. Dump flag Pass Specifies whether the dump command will create a backup of the filesystem. Filesystems with no value or a value of zero will not be dumped. Specifies the order in which filesystems are checked at boot time. No value or a value of zero specifies that the filesystem will not be checked. Institute of Aga Linux LPI Niyaz M. Salih (53)

55 Chapter 12: File Security Standard file Permissions file ownership user owner and group owner The users and groups of a system can be locally managed in /etc/passwd and /etc/group, or they can be in a NIS, LDAP, or Samba domain. These users and groups can own files. Actually, every file has a user owner and a group owner, as can be seen in the following screenshot. This file is owned by the root user and the root group. listing user accounts You can use the following command to list all local user accounts. chgrp You can change the group owner of a file using the chgrp command. Institute of Aga Linux LPI Niyaz M. Salih (54)

56 chown The user owner of a file can be changed with chown command. You can also use chown to change both the user owner and the group owner. List of special files When you use ls -l, for each file you can see ten characters before the user and group owner. The first character tells us the type of file. Regular files get a -, directories get a d, symbolic links are shown with an l, pipes get a p, character devices a c, block devices a b, and sockets an s. Institute of Aga Linux LPI Niyaz M. Salih (55)

57 Unix special files first character file type - normal file D L P B C S directory symbolic link named pipe block device character device socket Below a screenshot of a character device (the console) and a block device (the hard disk). And here you can see a directory, a regular file and a symbolic link. permissions rwx The nine characters following the file type denote the permissions in three triplets. A permission can be r for read access, w for write access, and x for execute. You need the r permission to list (ls) the contents of a directory. You need the x permission to enter (cd) a directory. You need the w permission to create files in or remove files from a directory. Institute of Aga Linux LPI Niyaz M. Salih (56)

58 Standard Unix file permissions permission on a file on a directory r (read) w (write) read file contents (cat) read directory contents (ls) change file contents (vi) create files in (touch) x (execute) execute the file enter the directory (cd) Three sets of rwx We already know that the output of ls -l starts with ten characters for each file. This screenshot shows a regular file (because the first character is a -). Below is a table describing the function of all ten characters. Unix file permissions position position characters function 1 - this is a regular file 2-4 rwx permissions for the user owner 5-7 r-x permissions for the group owner 8-10 r-- permissions for others When you are the user owner of a file, then the user owner permissions apply to you. The rest of the permissions have no influence on your access to the file. Institute of Aga Linux LPI Niyaz M. Salih (57)

59 When you belong to the group that is the group owner of a file, then the group owner permissions apply to you. The rest of the permissions have no influence on your access to the file. When you are not the user owner of a file and you do not belong to the group owner, then the others permissions apply to you. The rest of the permissions have no influence on your access to the file. To summarise, the first rwx triplet represents the permissions for the user owner. The second triplet corresponds to the group owner; it specifies permissions for all members of that group. The third triplet defines permissions for all other users that are not the user owner and are not a member of the group owner. Setting permissions (chmod) Permissions can be changed with chmod. The first example gives the user owner execute permissions. Institute of Aga Linux LPI Niyaz M. Salih (58)

60 Setting octal permissions Most Unix administrators will use the old school octal system to talk about and set permissions. Look at the triplet bitwise, equating r to 4, w to 2, and x to 1. Octal permissions binary octal permission x w wx r r-x rw rwx This makes 777 equal to rwxrwxrwx and by the same logic, 654 mean rw-rxr--. The chmod command will accept these numbers. Institute of Aga Linux LPI Niyaz M. Salih (59)

61 umask When creating a file or directory, a set of default permissions are applied. These default permissions are determined by the umask. The umask specifies permissions that you do not want set on by default. You can display the umask with the umask command. mkdir -m When creating directories with mkdir you can use the -m option to set the mode. This screenshot explains. cp -p To preserve permissions and time stamps from source files, use cp -p. Institute of Aga Linux LPI Niyaz M. Salih (60)

62 Access Control Lists acl in /etc/fstab File systems that support access control lists, or acls, have to be mounted with the acl option listed in /etc/fstab. In the example below, you can see that the root file system has acl support, whereas /home/data does not. getfacl Reading acls can be done with /usr/bin/getfacl. This screenshot shows how to read the acl of niyaz with getfacl. setfacl Writing or changing acls can be done with /usr/bin/setfacl. These screenshots show how to change the acl of niyaz with setfacl. First we add user serverme with octal permission 7 to the acl. Then we add the group tennis with octal permission 6 to the acl of the same file. Institute of Aga Linux LPI Niyaz M. Salih (61)

63 remove an acl entry The -x option of the setfacl command will remove an acl entry from the targeted file. Note that omitting the u or g when defining the acl for an account will default it to a user account. remove the complete acl The -b option of the setfacl command will remove the acl from the targeted file. Institute of Aga Linux LPI Niyaz M. Salih (62)

64 the acl mask The acl mask defines the maximum effective permissions for any entry in the acl. This mask is calculated every time you execute the setfacl or chmod commands. You can prevent the calculation by using the --no-mask switch. Institute of Aga Linux LPI Niyaz M. Salih (63)

65 Chapter 13: Local user management Enabling the root user To run administrative tasks in Linux, you must have root (also known as super user) access. Having a separate root account is common in most Linux distributions, but Ubuntu disables root by default. This prevents users from making mistakes and keeps the system safe from intruders. To run commands that require root access, use sudo Managing Users and Groups There are four main user administration files /etc/passwd Keeps the user account and password information. This file holds the majority of information about accounts on the Unix system. /etc/shadow Holds the encrypted password of the corresponding account. Not all the systems support this file. /etc/group This file contains the group information for each account. /etc/gshadow This file contains secure group account information. Check all the above files using the cat command. Institute of Aga Linux LPI Niyaz M. Salih (64)

66 S.No. Command & Description 1 useradd Adds accounts to the system 2 usermod 3 userdel Modifies account attributes Deletes accounts from the system 4 groupadd Adds groups to the system 5 groupmod Modifies group attributes 6 groupdel Removes groups from the system Create a Group We will now understand how to create a group. For this, we need to create groups before creating any account otherwise, we can make use of the existing groups in our system. We have all the groups listed in /etc/groups file. All the default groups are system account specific groups and it is not recommended to use them for ordinary accounts. So, following is the syntax to create a new group account Institute of Aga Linux LPI Niyaz M. Salih (65)

67 groupadd [-g gid [-o]] [-r] [-f] groupname The following table lists out the parameters S.No. Option & Description 1 -g GID The numerical value of the group's ID 2 -o 3 -r 4 -f This option permits to add group with non-unique GID This flag instructs groupadd to add a system account This option causes to just exit with success status, if the specified group already exists. With -g, if the specified GID already exists, other uniqueunique GID is chosen 5 groupname Actual group name to be created If you do not specify any parameter, then the system makes use of the default values. Institute of Aga Linux LPI Niyaz M. Salih (66)

68 Following example creates a developers group with default values, which is very much acceptable for most of the administrators. Modify a Group To modify a group, use the groupmod syntax $ groupmod -n new_modified_group_name old_group_name To change the developers group name to developer_2, type Here is how you will change the financial GID to 545 Delete a Group We will now understand how to delete a group. To delete an existing group, all you need is the groupdel command and the group name. To delete the financial group, the command is This removes only the group, not the files associated with that group. The files are still accessible by their owners. Institute of Aga Linux LPI Niyaz M. Salih (67)

69 Create an Account Let us see how to create a new account on your Unix system. Following is the syntax to create a user's account useradd -d homedir -g groupname -m -s shell -u userid accountname The following table lists out the parameters S.No. Option & Description 1 -d homedir Specifies home directory for the account 2 -g groupname 3 -m 4 -s shell Specifies a group account for this account Creates the home directory if it doesn't exist Specifies the default shell for this account 5 -u userid You can specify a user id for this account 6 accountname Actual account name to be created If you do not specify any parameter, then the system makes use of the default values. The useradd command modifies. Institute of Aga Linux LPI Niyaz M. Salih (68)

70 the /etc/passwd, /etc/shadow, and /etc/group files and creates a home directory. Following is the example that creates an account aga. Setting its home directory to /home/aga and the group as developers. This user would have Korn Shell assigned to it. Before issuing the above command, make sure you already have the developers group created using the groupadd command. Once an account is created you can set its password using the passwd command as follows When you type passwd accountname, it gives you an option to change the password, provided you are a superuser. Otherwise, you can change just your password using the same command but without specifying your account name. Modify an Account The usermod command enables you to make changes to an existing account from the command line. It uses the same arguments as the useradd command, plus the -l argument, which allows you to change the account name. For example, to change the account name aga to aga2 and to change home directory accordingly, you will need to issue the following command Institute of Aga Linux LPI Niyaz M. Salih (69)

71 Delete an Account The userdel command can be used to delete an existing user. This is a very dangerous command if not used with caution. There is only one argument or option available for the command.r, for removing the account's home directory and mail file. For example, to remove account mcmohd20, issue the following command If you want to keep the home directory for backup purposes, omit the - r option. You can remove the home directory as needed at a later time. Institute of Aga Linux LPI Niyaz M. Salih (70)

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

Linux Essentials Objectives Topics:

Linux Essentials Objectives Topics: Linux Essentials Linux Essentials is a professional development certificate program that covers basic knowledge for those working and studying Open Source and various distributions of Linux. Exam Objectives

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

This is Worksheet and Assignment 12. Disks, Partitions, and File Systems

This is Worksheet and Assignment 12. Disks, Partitions, and File Systems This is Worksheet and Assignment 12 This is a combined Worksheet and Assignment.. Quizzes and tests may refer to work done in this Worksheet and Assignment; save your answers. You will use a checking program

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

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

*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

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

Disks, Filesystems 1

Disks, Filesystems 1 Disks, Filesystems 1 sudo and PATH (environment) disks partitioning formatting file systems: mkfs command checking file system integrity: fsck command /etc/fstab mounting file systems: mount command unmounting

More information

Presented by Bill Genske Gary Jackson

Presented by Bill Genske Gary Jackson Quintessential School Systems Session C Linux Presented by Bill Genske Gary Jackson Copyright Quintessential School Systems, 2009 All Rights Reserved 867 American Street --- Second Floor --- San Carlos,

More information

CST8207: GNU/Linux Operating Systems I Lab Seven Linux User and Group Management. Linux User and Group Management

CST8207: GNU/Linux Operating Systems I Lab Seven Linux User and Group Management. Linux User and Group Management Student Name: YOUR NAME Lab Section: 011 012 013 or 014 Linux User and Group Management 1 Due Date - Upload to Blackboard by 8:30am Monday April 2, 2012 Submit the completed lab to Blackboard following

More information

CST8207: GNU/Linux Operating Systems I Lab Seven Linux User and Group Management. Linux User and Group Management

CST8207: GNU/Linux Operating Systems I Lab Seven Linux User and Group Management. Linux User and Group Management Student Name: Lab Section: Linux User and Group Management 1 Due Date - Upload to Blackboard by 8:30am Monday April 2, 2012 Submit the completed lab to Blackboard following the Rules for submitting Online

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

Chapter 6. Linux File System

Chapter 6. Linux File System Chapter 6 Linux File System 1 File System File System management how to store informations on storage devices The Hierarchical Structure Types of file Common File system Tasks 2 The Hierarchical Structure

More information

Disks, Filesystems Todd Kelley CST8177 Todd Kelley 1

Disks, Filesystems Todd Kelley CST8177 Todd Kelley 1 Disks, Filesystems Todd Kelley kelleyt@algonquincollege.com CST8177 Todd Kelley 1 sudo and PATH (environment) disks partitioning formatting file systems: mkfs command checking file system integrity: fsck

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

Installation of the OS

Installation of the OS Lab 1 Installation of the OS 1.1 Objectives The goal of this first session is to install a Debian/Linux operating system from scratch on a Intel x86- based computer. The installation will be made on a

More information

Lab E2: bypassing authentication and resetting passwords

Lab E2: bypassing authentication and resetting passwords Lab E2: bypassing authentication and resetting passwords TTM4175 September 7, 2015 The purpose of this lab is to learn about techniques for bypassing the authentication and access control of Windows and

More information

MANAGING THE NONUNIFORM BEHAVIOUR OF TERMINALS AND KEYBOARDS. : WHEN THINGS GO WRONG

MANAGING THE NONUNIFORM BEHAVIOUR OF TERMINALS AND KEYBOARDS. : WHEN THINGS GO WRONG MANAGING THE NONUNIFORM BEHAVIOUR OF TERMINALS AND KEYBOARDS. : WHEN THINGS GO WRONG Terminals and keyboards have no uniform behavioral pattern. Terminal settings directly impact the keyboard operation.

More information

User Accounts. The Passwd, Group, and Shadow Files

User Accounts. The Passwd, Group, and Shadow Files User Accounts The Passwd, Group, and Shadow Files We'll start with the passwd (pronounced "password") file, located at /etc/passwd. This file holds information about all of the user accounts on the system.

More information

Introduction to Unix and Linux. Workshop 1: Directories and Files

Introduction to Unix and Linux. Workshop 1: Directories and Files Introduction to Unix and Linux Workshop 1: Directories and Files Genomics Core Lab TEXAS A&M UNIVERSITY CORPUS CHRISTI Anvesh Paidipala, Evan Krell, Kelly Pennoyer, Chris Bird Genomics Core Lab Informatics

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

Linux File System and Basic Commands

Linux File System and Basic Commands Linux File System and Basic Commands 0.1 Files, directories, and pwd The GNU/Linux operating system is much different from your typical Microsoft Windows PC, and probably looks different from Apple OS

More information

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou EECS 2031 - Software Tools Lab 2 Tutorial: Introduction to UNIX/Linux Tilemachos Pechlivanoglou (tipech@eecs.yorku.ca) Sep 22 & 25, 2017 Material marked with will be in your exams Sep 22 & 25, 2017 Introduction

More information

GNU/Linux Course Lesson 1. Puria Nafisi

GNU/Linux Course Lesson 1. Puria Nafisi GNU/Linux Course Lesson 1 Puria Nafisi Azizi @pna http://netstudent.polito.it Netstudent is an students volunteer association within the Politecnico di Torino. Is build of different people and students

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

The Ultimate Linux/Windows System

The Ultimate Linux/Windows System The Ultimate Linux/Windows System Kevin Farnham Abstract Use cross-platform applications and shared data for the ultimate Linux/Windows system. I recently converted my Toshiba notebook computer into a

More information

INF322 Operating Systems

INF322 Operating Systems Galatasaray University Computer Engineering Department INF322 Operating Systems TP01: Introduction to Linux Ozan Çağlayan ocaglayan@gsu.edu.tr ozancaglayan.com Fundamental Concepts Definition of Operating

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

Introduction to Linux Basics

Introduction to Linux Basics Introduction to Linux Basics Part-I Georgia Advanced Computing Resource Center University of Georgia Zhuofei Hou, HPC Trainer zhuofei@uga.edu Outline What is GACRC? What is Linux? Linux Command, Shell

More information

UNIX, GNU/Linux and simple tools for data manipulation

UNIX, GNU/Linux and simple tools for data manipulation UNIX, GNU/Linux and simple tools for data manipulation Dr Jean-Baka DOMELEVO ENTFELLNER BecA-ILRI Hub Basic Bioinformatics Training Workshop @ILRI Addis Ababa Wednesday December 13 th 2017 Dr Jean-Baka

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

CS246 Spring14 Programming Paradigm Notes on Linux

CS246 Spring14 Programming Paradigm Notes on Linux 1 Unix History 1965: Researchers from Bell Labs and other organizations begin work on Multics, a state-of-the-art interactive, multi-user operating system. 1969: Bell Labs researchers, losing hope for

More information

Using grub to Boot various Operating Systems

Using grub to Boot various Operating Systems Operating Systems and Systems Integration Using grub to Boot various Operating Systems Contents 1 Aim 2 2 What You Will Do 2 3 Background 2 3.1 Installing grub in MBR from a floppy, and from the OS........

More information

Filesystem Hierarchy and Permissions

Filesystem Hierarchy and Permissions and Linux Prepared by Steven Gordon on 19 April 2017 Common/Reports/linux-file-permissions.tex, r1417 1/15 Multiuser and Server Operating System Linux systems are commonly used as a multi-user system E.g.

More information

An Introduction to Using the Command Line Interface (CLI) to Work with Files and Directories

An Introduction to Using the Command Line Interface (CLI) to Work with Files and Directories An Introduction to Using the Command Line Interface (CLI) to Work with Files and Directories Mac OS by bertram lyons senior consultant avpreserve AVPreserve Media Archiving & Data Management Consultants

More information

CS197U: A Hands on Introduction to Unix

CS197U: A Hands on Introduction to Unix CS197U: A Hands on Introduction to Unix Lecture 4: My First Linux System Tian Guo University of Massachusetts Amherst CICS 1 Reminders Assignment 2 was due before class Assignment 3 will be posted soon

More information

User Commands chmod ( 1 )

User Commands chmod ( 1 ) NAME chmod change the permissions mode of a file SYNOPSIS chmod [-fr] absolute-mode file... chmod [-fr] symbolic-mode-list file... DESCRIPTION The chmod utility changes or assigns the mode of a file. The

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

Linux Interview Questions and Answers

Linux Interview Questions and Answers Linux Interview Questions and Answers You need to see the last fifteen lines of the files dog, cat and horse. What command should you use? tail -15 dog cat horse The tail utility displays the end of a

More information

Introduction to Unix May 24, 2008

Introduction to Unix May 24, 2008 Introduction to Unix May 24, 2008 Exercises: Privileges REFERENCE Reference: Shah, Steve, "Linux Administration: A Beginner's Guide", 2nd. ed., Osborne press, New York, NY. If you look at files in a directory

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

Software I: Utilities and Internals

Software I: Utilities and Internals Software I: Utilities and Internals Lecture 3 File System Commands The File System A file in UNIX is a sequence of bytes. UNIX imposes no structure in a file and there is no extension implicit in a file

More information

Exercise 4: Access Control and Filesystem Security

Exercise 4: Access Control and Filesystem Security Exercise 4: Access Control and Filesystem Security Introduction Duration: 90 min Maximum Points: 30 Note: The solutions of theorethical assignments should be handed out before the practical part in the

More information

Topics. Installation Basics of Using GNU/ Linux Administration Tools

Topics. Installation Basics of Using GNU/ Linux Administration Tools GNU/ Linux Basics Topics Installation Basics of Using GNU/ Linux Administration Tools Installation Installing Using the GUI Disc Partitioning Allocation of swap space Selection of packages to install Configuring

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

SIEMENS UserAdmin Workshop TELEPERM XP Version 4 Chapter 1

SIEMENS UserAdmin Workshop TELEPERM XP Version 4 Chapter 1 1 UNIX... 1-2 1.1 USER-ENVIRONMENT... 1-2 1.1.1 User-environment... 1-3 1.1.2 Basic commands... 1-3 1.1.3 SCO Unix specific commands... 1-4 1.1.4 HP Unix specific commands... 1-4 1.2 FILE SYSTEM... 1-5

More information

"Charting the Course... MOC B: Linux System Administration. Course Summary

Charting the Course... MOC B: Linux System Administration. Course Summary Description Course Summary This four-day instructor-led course is designed to provide students with the necessary skills and abilities to work as a professional Linux system administrator. The course covers

More information

Practical 4. Linux Commands: Working with Directories

Practical 4. Linux Commands: Working with Directories Practical 4 Linux Commands: Working with Directories 1. pwd: pwd stands for Print Working Directory. As the name states, command pwd prints the current working directory or simply the directory user is,

More information

Basic File Attributes

Basic File Attributes Basic File Attributes The UNIX file system allows the user to access other files not belonging to them and without infringing on security. A file has a number of attributes (properties) that are stored

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

Partitioning and Formatting Guide

Partitioning and Formatting Guide Partitioning and Formatting Guide Version 1.2 Date 05-15-2006 Partitioning and Formatting Guide This guide is designed to explain how to setup your drive with the correct partition and format for your

More information

Installing caos with Cinch on Floppy Disk

Installing caos with Cinch on Floppy Disk Installing caos with Cinch on Floppy Disk Troy Andrew Johnson May 21, 2004 Abstract cinch is the caos Linux (http://www.caosity.org/) installer. Prerequisites What you need: two floppy disks (at least)

More information

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2 CSE Linux VM For Microsoft Windows Based on opensuse Leap 42.2 Dr. K. M. Flurchick February 2, 2017 Contents 1 Introduction 1 2 Requirements 1 3 Procedure 1 4 Usage 3 4.1 Start/Stop.................................................

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

The UNIX Operating System. HORT Lecture 2 Instructor: Kranthi Varala

The UNIX Operating System. HORT Lecture 2 Instructor: Kranthi Varala The UNIX Operating System HORT 59000 Lecture 2 Instructor: Kranthi Varala Operating Systems Image By Golftheman - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=4558519 Operating

More information

MIS Week 10. Operating System Security. Unix/Linux basics

MIS Week 10. Operating System Security. Unix/Linux basics MIS 5170 Operating System Security Week 10 Unix/Linux basics Tonight s Plan 2 Questions from Last Week Review on-line posts In The News Download Kali Install Kali Unix/Linux Basics Scripting Appropriate

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

GNU/Linux: An Essential Guide for Students Undertaking BLOSSOM

GNU/Linux: An Essential Guide for Students Undertaking BLOSSOM Copyright: The development of this document is funded by Higher Education of Academy. Permission is granted to copy, distribute and /or modify this document under a license compliant with the Creative

More information

User Commands ls ( 1 )

User Commands ls ( 1 ) NAME ls list contents of directory SYNOPSIS /usr/bin/ls [-aabccdffghillmnopqrrstux1@] [file...] /usr/xpg4/bin/ls [-aabccdffghillmnopqrrstux1@] [file...] DESCRIPTION For each file that is a directory, ls

More information

Post Ubuntu Install Exercises

Post Ubuntu Install Exercises Post Ubuntu Install Exercises PacNOG 3 June 18 Rarotonga, Cook Islands 1. Get used to using sudo 2. Create an ainst account 3. Learn how to install software 4. Install gcc and make 5. Learn how to control

More information

COMS 6100 Class Notes 3

COMS 6100 Class Notes 3 COMS 6100 Class Notes 3 Daniel Solus September 1, 2016 1 General Remarks The class was split into two main sections. We finished our introduction to Linux commands by reviewing Linux commands I and II

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

MINI-HOWTO backup and/or restore device or partition using zsplit/unzsplit

MINI-HOWTO backup and/or restore device or partition using zsplit/unzsplit MINI-HOWTO backup and/or restore device or partition using zsplit/unzsplit Jurij Ivastsuk-Kienbaum jurij [at] device-image.de Revision History First draft March 14, 2006 This document describes a setup

More information

CSN09101 Networked Services. Module Leader: Dr Gordon Russell Lecturers: G. Russell

CSN09101 Networked Services. Module Leader: Dr Gordon Russell Lecturers: G. Russell CSN09101 Networked Services Week 3 : Users, Permissions, Processes, and Pipes Module Leader: Dr Gordon Russell Lecturers: G. Russell This lecture Users File permissions Processes Hard and soft links USERS

More information

How to Dual-Boot OS X and Ubuntu

How to Dual-Boot OS X and Ubuntu How to Dual-Boot OS X and Ubuntu Nailen Matschke - nailen@caltech.edu 10/3/2015 What you need: 1. A USB drive with at least 2 GB of space, that you don t mind wiping 2. A copy of Ubuntu (available here),

More information

NETW 110 Lab 3 Post-Installation Configuration Page 1

NETW 110 Lab 3 Post-Installation Configuration Page 1 NETW 110 Lab 3 Post-Installation Configuration Page 1 Objective At the conclusion of this lab, the student will learn some very basic functions of vi, use vi to perform some post-installation configuration

More information

Using ACLs with Fedora Core 2 (Linux Kernel 2.6.5)

Using ACLs with Fedora Core 2 (Linux Kernel 2.6.5) Using ACLs with Fedora Core 2 (Linux Kernel 2.6.5) Back to Index By Van Emery Table of Contents Introduction Assumptions Getting Started Using ACLs More setfacl Details and Examples Example Scenario The

More information

Operating Systems, Unix Files and Commands SEEM

Operating Systems, Unix Files and Commands SEEM Operating Systems, Unix Files and Commands SEEM 3460 1 Major Components of Operating Systems (OS) Process management Resource management CPU Memory Device File system Bootstrapping SEEM 3460 2 Programs

More information

Introduction Into Linux Lecture 1 Johannes Werner WS 2017

Introduction Into Linux Lecture 1 Johannes Werner WS 2017 Introduction Into Linux Lecture 1 Johannes Werner WS 2017 Table of contents Introduction Operating systems Command line Programming Take home messages Introduction Lecturers Johannes Werner (j.werner@dkfz-heidelberg.de)

More information

Mid Term from Feb-2005 to Nov 2012 CS604- Operating System

Mid Term from Feb-2005 to Nov 2012 CS604- Operating System Mid Term from Feb-2005 to Nov 2012 CS604- Operating System Latest Solved from Mid term Papers Resource Person Hina 1-The problem with priority scheduling algorithm is. Deadlock Starvation (Page# 84) Aging

More information

BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description:

BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description: BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description: This course provides Bioinformatics students with the

More information

Unix/Linux Operating System. Introduction to Computational Statistics STAT 598G, Fall 2011

Unix/Linux Operating System. Introduction to Computational Statistics STAT 598G, Fall 2011 Unix/Linux Operating System Introduction to Computational Statistics STAT 598G, Fall 2011 Sergey Kirshner Department of Statistics, Purdue University September 7, 2011 Sergey Kirshner (Purdue University)

More information

How to Use This Lab Manual

How to Use This Lab Manual 3 Contents How to Use This Lab Manual........................................ 5 Lab 1: Setting Up the Student System.................................. 7 Lab 2: Installing Fedora............................................

More information

Chap2: Operating-System Structures

Chap2: Operating-System Structures Chap2: Operating-System Structures Objectives: services OS provides to users, processes, and other systems structuring an operating system how operating systems are designed and customized and how they

More information

UNIX. Basic UNIX Command

UNIX. Basic UNIX Command UNIX Basic UNIX Command Command List ls mkdir mv chmod groupadd hostname kill head top compress/ uncompress pwd Cat find chown useradd id ioscan pdf sar cd more grep chgrp passwd mount dmesg netstat tar

More information

Lecture 02: Linux Command Line

Lecture 02: Linux Command Line BI296: Linux and Shell Programming Lecture 02: Linux Command Line Maoying,Wu ricket.woo@gmail.com Dept. of Bioinformatics & Biostatistics Shanghai Jiao Tong University Spring, 2017 Quick Recaps Decimal/Binary/Octal/Hexadecimal

More information

Unix/Linux: History and Philosophy

Unix/Linux: History and Philosophy Unix/Linux: History and Philosophy History and Background Multics project Unix Linux Multiplexed Information and Computing Service Collaborative venture between General Electric, Bell Telephone Labs, and

More information

TestOut Linux Pro - English 4.0.x OBJECTIVE MAPPING: CompTIA Linux+ LX0-103

TestOut Linux Pro - English 4.0.x OBJECTIVE MAPPING: CompTIA Linux+ LX0-103 TestOut Linux Pro - English 4.0.x OBJECTIVE MAPPING: CompTIA Linux+ LX0-103 CompTIA Linux+ Powered by LPI LX0-103 Objectives The Linux+ Powered by LPI Exam: LX0-103 exam covers the following topics. #

More information

System Programming. Introduction to Unix

System Programming. Introduction to Unix Content : by Dr. B. Boufama School of Computer Science University of Windsor Instructor: Dr. A. Habed adlane@cs.uwindsor.ca http://cs.uwindsor.ca/ adlane/60-256 Content Content 1 Introduction 2 3 Introduction

More information

In this exercise you will practice working with HDFS, the Hadoop. You will use the HDFS command line tool and the Hue File Browser

In this exercise you will practice working with HDFS, the Hadoop. You will use the HDFS command line tool and the Hue File Browser Access HDFS with Command Line and Hue Data Files (local): ~/labs/data/kb/* ~/labs/data/base_stations.tsv In this exercise you will practice working with HDFS, the Hadoop Distributed File System. You will

More information

commands exercises Linux System Administration and IP Services AfNOG 2015 Linux Commands # Notes

commands exercises Linux System Administration and IP Services AfNOG 2015 Linux Commands # Notes Linux System Administration and IP Services AfNOG 2015 Linux Commands # Notes * Commands preceded with "$" imply that you should execute the command as a general user not as root. * Commands preceded with

More information

CSc33200: Operating Systems, CS-CCNY, Fall 2003 Jinzhong Niu September 26, Nachos Overview

CSc33200: Operating Systems, CS-CCNY, Fall 2003 Jinzhong Niu September 26, Nachos Overview CSc33200: Operating Systems, CS-CCNY, Fall 2003 Jinzhong Niu September 26, 2003 Nachos Overview Operating Systems is one of the fundamental courses for a student who majors in computer software. A good

More information

Introduction to Linux Part 1. Anita Orendt and Wim Cardoen Center for High Performance Computing 24 May 2017

Introduction to Linux Part 1. Anita Orendt and Wim Cardoen Center for High Performance Computing 24 May 2017 Introduction to Linux Part 1 Anita Orendt and Wim Cardoen Center for High Performance Computing 24 May 2017 ssh Login or Interactive Node kingspeak.chpc.utah.edu Batch queue system kp001 kp002. kpxxx FastX

More information

There is a general need for long-term and shared data storage: Files meet these requirements The file manager or file system within the OS

There is a general need for long-term and shared data storage: Files meet these requirements The file manager or file system within the OS Why a file system? Why a file system There is a general need for long-term and shared data storage: need to store large amount of information persistent storage (outlives process and system reboots) concurrent

More information

My Favorite bash Tips and Tricks

My Favorite bash Tips and Tricks 1 of 6 6/18/2006 7:44 PM My Favorite bash Tips and Tricks Prentice Bisbal Abstract Save a lot of typing with these handy bash features you won't find in an old-fashioned UNIX shell. bash, or the Bourne

More information

Linux crash lecture by Andrey Lukyanenko

Linux crash lecture by Andrey Lukyanenko Linux crash lecture by Andrey Lukyanenko T-110.5102 Laboratory Works in Networking and Security 20.1.2015 Otaniemi based on material of Miika Komu, 2013 Traversing Directories cd Change Directory Change

More information

About the Presentations

About the Presentations About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning of each presentation. You may customize the presentations

More information

Operating Systems Linux 1-2 Measurements Background material

Operating Systems Linux 1-2 Measurements Background material Operating Systems Linux 1-2 Measurements Background material Introduction The Linux measurements were designed to allow you to have an impression about the administration of Linux severs along with providing

More information

CST8177 Linux II. Linux Boot Process

CST8177 Linux II. Linux Boot Process CST8177 Linux II Linux Boot Process Reference information from the text, http://www.linuxdoc.org and several other web sites Linux Boot Process Topics covered in this slide-set Basic definition of the

More information

Introduction to Linux Command-Line for Beginners

Introduction to Linux Command-Line for Beginners Introduction to Linux Command-Line for Beginners This tutorial went through some changes since I've posted it on the TuxArena Blog over one year ago, and I believe this version is more complete and well-organized.

More information

An introduction to Logical Volume Management

An introduction to Logical Volume Management An introduction to Logical Volume Management http://distrowatch.com/weekly.php?issue=20090309 For users new to Linux, the task of switching operating systems can be quite daunting. While it is quite similar

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

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

Open Source Computational Fluid Dynamics

Open Source Computational Fluid Dynamics Open Source Computational Fluid Dynamics An MSc course to gain extended knowledge in Computational Fluid Dynamics (CFD) using open source software. Teachers: Miklós Balogh and Zoltán Hernádi Department

More information

Disk Imaging with Knoppix

Disk Imaging with Knoppix Introduction This document explains how to use the CD-ROM bootable version of Linux, named Knoppix, to make and restore images of computer hard drives. Knoppix makes a very good system recovery tool for

More information

How to clone a Linux box using netcat

How to clone a Linux box using netcat How to clone a Linux box using netcat Dr. Emiliano Bruni info@ebruni.it Version 0.01 $Date: 2003/08/22 14:52:15 $ Many times it s necessary to have a clone of a linux box without modifying the original

More information

Linux Reference Card - Command Summary

Linux Reference Card - Command Summary Linux Reference Card - Command Summary adduser adduser dsoneil This command will automatically add a new user to the system The Bash script can be found in /usr/sbin if it needs to be changes alias alias

More information