Linux OS module 1-3
3 Common SCSI device files:
1. /dev/sda - First hard disk 2. /dev/sdb - Second hard disk 3. /dev/sda3 - Third partition on the first hard disk
3 most common pseudo devices
1. /dev/zero - accepts and discards all input, produces a continuous stream of NULL (zero value) bytes 2. /dev/null - accepts and discards all input, produces no output 3. /dev/random - produces random numbers
Hard Link [ ln ]
A hard link always points a filename to data on a storage device. Files that are hard-linked together share the same inode number.
Unix/ Linux uses a hierarchical directory structure. True False
True
In ls, the type of device file is that is denoted with 'p' ?
pipe; Named pipes allow two or more processes to communicate with each other, these are similar to character devices, but instead of having output sent to a device, it's sent to another process.
resize
resize a partition
/root
root users home directory
In ls, the type of device file is that is denoted with 's' ?
socket; Socket devices facilitate communication between processes, similar to pipe devices but they can communicate with many processes at once.
parted
this is a command line tool that supports both MBR and GPT partitioning
gparted
this is the GUI version of parted
sudo umount
unmount a device from a mount point:
/proc
Information about currently running processes.
/run
Information about the running system since the last boot.
mkpart
Linux command to partition a disk within interactive parted tool. requires 4 pieces of info - type of partition - file system - start of the disk - end of the disk
/usr
Location of User applications and utilities
/opt
Optional application software packages.
/home
Personal directories for users, holds your documents, files, settings, etc.
dd
Reads bit stream and writes it to a file or data stream. Command to make a bit stream image of your hard drive/solid-state drive.
/srv
Site-specific data which are served by the system.
/tmp
Storage for temporary files
/mnt
Temporarily mounted filesystems.
/
The root directory of the entire filesystem hierarchy, everything is nestled under this directory.
What two types of partition tables are there?
There are two main partition table schemes used, Master Boot Record (MBR) and GUID Partition Table (GPT).
/etc/fstab
This file contains a permanent list of filesystems that are mounted.
ACLs (access control list) allow us to specify a more granular set of permissions to files and directories over the regular method of setting permissions. True False
True
Files are containers for storing data and directories are containers for storing files. True False
True
gdisk
fdisk, but it does not support MBR only GPT
Features of the Unix/Linux operating system include: a. large repository of apps b. constant updates/releases c. rich programming tools d. high level of performance e. available on all modern hardware platforms f. easily scable g. All of the above!
g. all of the above (large repository, constant updates, rich programming tools, high level of performance, available on modern hardware platforms, easily scalable)
Sysfs
is a virtual filesystem, most often mounted to the /sys directory. It gives us more detailed information than what we would be able to see in the /dev directory.
sudo mount
mount point is a directory on the system where the filesystem is going to be attached
fsck
(filesystem check) command is used to check the consistency of a filesystem and can even try to repair it for us.
mkfs
(make filesystem) tool allows us to specify the type of filesystem we want and where we want it.
/lib
Holds library files that binaries can use.
Soft link (symbolic link) [ ln -s ]
A soft link always points a filename to another filename, which then points to information on a storage device. The biggest concern is data loss and data confusion. If the original file is deleted, the soft link is broken.
What is an inode?
An inode (index node) is an entry in this table and there is one for every file.
/bin
Binaries and executables Essential ready-to-run programs, includes the most basic commands such as ls and cp.
/sbin
Contains essential system binaries, usually can only be ran by root.
/boot
Contains kernel boot loader files.
/dev
Device files
Disk Partition
Disks are comprised of partitions that help us organize our data. You can have multiple partitions on a disk and they can't overlap each other.
Partition Table
Every disk will have a partition table, this table tells the system how the disk is partitioned. This table tells you where partitions begin and end, which partitions are bootable, what sectors of the disk are allocated to what partition, etc.
What data is in an inode?
File type - regular file, directory, character device, Owner Group Access permissions Timestamps - mtime (time of last file modification), ctime (time of last attribute change), atime (time of last access) Number of hardlinks to the file Size of the file Number of blocks allocated to the file Pointers to the data blocks of the file
/media
Used as an attachment point for removable media like USB drives.
/var
Variable directory, log files
Select all that apply: Which of the following are type files? a. Link (|) b. Files (-) c. Directories (d) d. Character devices (c) e. Block device (b) f. Additional types not listed
a. Link b. Files c. Directories d. Character devices e. Block device f. Additional types not listed
Which of the following commands would you use to pull selected lines of text from a file that matches a certain pattern? a. grep b. parse c. pull d. All of the above!
a. grep
Which of the following commands would you use to review the last commands executed at the command line for the user that you are currently logged on as? a. history b. date c. sh d. stty
a. history
A _____________ is a component in Unix that runs on top of the kernel and provides a command line user environment a. shell b. window c. graphic user interface d. X-Windows
a. shell
Which of the following commands would you use to review your terminal settings? a. stty b. term c. reset d. show
a. stty
Which directory is commonly used to store system configuration files? a. /bin b. /etc c. /var d. /conf
b. /etc
_______________ is software that manages the computer's hardware and provides a convenient and safe environment for running programs. It acts as an interface between programs and the hardware (CPU, RAM, hard disk drive, printer, CD-ROM, etc). a. Application b. Operating system c. Driver d. Middle Ware
b. Operating System
Which of the following commands would you use to print a string of text to the monitor? a. print b. echo c. show d. output
b. echo
Which of the following commands would you use to see when a file was last modified? a. dir b. ls -l d. date e. when
b. ls -l
fdisk
basic command-line partitioning tool, it does not support GPT
In ls type of device file is that is denoted with 'b' ?
block; These devices transfer data, but in large fixed-sized blocks.
Unix is written in the ________ programming language. This allows for portability across hardware platforms. a. assembler b. Python c. C d. Fortran
c. C (programming language)
To change the permissions associated with a file, use the ____________ command. a. chgrp b. chmod c. perm d. chown
c. Chmod
Which of the following commands would you use after a command with a pipe | to control paging on the monitor? a. less b. more c. both of the above answers are correct! d. No answer text provided.
c. both! (less & more)
What is the unique number that identifies a file in the filesystem? a. file size b. link number c. inode number d. file name
c. inode number
To set a pointer with a new name or location to an existing file without making a second copy of the file, use the ____________ command. a. ls b. link c. ln d. point
c. ln
Which of the following commands would you use to send mail to another user on the UNIX system? a. send b. oak c. mail or mailx d. xchang
c. mail or mailx
Which of the following commands would you use to determine what directory you are current in? a. ls b. who c. pwd e. dir
c. pwd
When you delete a __________ link, only the link is deleted, not the file itself. a. named b. hard c. symbolic d. temporary
c. symbolic
In ls type of device file is that is denoted with 'c' ?
character; These devices transfer data, but one a character at a time
df
command shows you the utilization of your currently mounted filesystems.
/etc
configuration files (no binaries)
Which of the following commands would you use to get help while using the UNIX command line? a. help b. man c. info d. all of the above
d. all of the above (help, man, info)
Which of the following applies to file names? a. Must be unique in the same directory b. Limited to 255 characters c. Can contain upper and lower case letters, numbers, and some special characters d. All of the above!
d. all of the above (must be unique, limited to 255 characters, contains upper/lowercase letters, numbers & letters)
Which of the following commands would you use to change your password for your user account? a. password b. chpass d. passwd e. set
d. passwd
On the Unix / Linux operating system, the system admin user account is ___________________. a. superuser b. sysadmin c. administrator d. root
d. root
udev (daemon)
dynamically creates and removes device files for us depending on whether or not they are connected