Topic4: Devices, Linux Filesystems, Filesystems Hierarchy Standards (90) Flashcards
Westminster Road
- Attic
umask value will result in default access permissions of 600 (rw——) for files and 700 (rwx——–) for directories
0077
077
- Attic Fan
cmd unmount /mnt with error message. umount: /mnt: device is busy
user has a file open in /mnt directory
- Stairs
cmd used to modify quota settings
edquota
- 2nd floor landing
following cmds will mount an already inserted CDROM in /dev/sr0 onto an existing directory /mnt/cdrom when issued with root priv
mount -t cdrom /dev/sr0 /mnt/cdrom
- Back stairs to first floor
in compliance with FHS what directories are doc files found
/var/share/doc
- 2nd FLoor Bathroom Shower
common linux cmds for file management
mv
cp
mkdir
- 2nd Floor Bathroom Closet
cmd display inode usege of each mounted filesystem
df -i
- 2nd floor Bathroom Window
cmd shows all libraries required by binary executable or another shared library
ldd
- 2nd Floor Bathroom Toilet
SysV init config file used to set default run level
inittab
- 2nd floor bathroom Mirror
instead of supplying explicit device in /etc/fstab for mounting, what other options may be used to id the intended partition
LABEL
UUID
- 2nd floor Bathroom door
option must be passed to a filesystems entry in /etc/fstab in order to mount the file system without root priveleges
user
- Christine’s Room Dresser
cmd will change CR-LF pairs in an imported text file, userlist.txt to linux standard LF characters and store it as newlist.txt
tr -d ‘\r’ < userlist.txt > newlist.txt
- Christine’s Bookshelf
normal mode in VI what char can be used to begin a reverse search
?
- Christine’s Window
chown cmd will change ownership to dave and the group to staff on a file named data.txt
chown dave:staff data.txt
- Christine’s Bed
what does mount -a do
mounts all filesystems listed in /etc/fstab that have option auto set.
- Christine’s Door
vi editor what cmd will copy (but not paste) from current line at the cursor and the following 16 lines (17 lines total).
17yy
- My Room Dresser
cmd shows definition of given shell cmd
type
- My Bed
process ID number of init process on a SysV init based system
1
- My WIndow 1
cmd used to search executable file foo when it has been placed in a directory not included in $PATH
find
- My Window 2
cmd print working directory in bash shell
pwd
21, My Desk
FHS where should binaries that have been compiled by sys admin be placed in order to be made available to all users on the system
/usr/local/bin
- My Book Case
cmd changes ownership of file.txt to the user dan and the group staff
chown dan:staff file.txt
- My Closet
describes a difference between GHU GRUB Legacy and GRUB 2
Partition numbers start at 0 in GRUP Legacy and 1 in GRUB 2
- My Door
cmd used to create an initialize the files used to store quota info
quotacheck
25 2nd floor Bannister
whats true about hard linked files
SAME
permissions and owner
inode filesystem
- Dad’s Master Bedroom Standing Dresser
cmd used to query info about available packages on Debian system
apt-cache
- Dad’s Master Bathroom Scrolltop Desk
list of files that would be installed by RPM package file apache-xml.rpm be previewed
rpm -qpl apache-xml.rpm
- Dad’s Master Bathroom Window
filesystem preallocates fixed number of inodes at the filesystem’s make/creation time and does NOT generate them as needed
ext2
ext3
- Dad’s Master Bedroom Bedside Table L
info of existing file is changed when hard link pointing to that file is created
Link count
- Dad’d Master Bedroom Bed Headboard
cmd creates ext3 filesystem on /dev/sdb1
/sbin/mke2fs -j /dev/sdb1
/sbin/mkfs -t ext3 /dev/sdb1
- Dad’s Master Bedroom Bed
partition type used for linux swap spaces when partitioning hard disk space
83
- Dad’s Master Bedroom Bedside Table R
cmd will print important system information such as kernel version and machine hardware architecture
uname
- Dad’s Master Bedroom Right side Window
cmd prints a list of available package updates when using RPM based pkg management
dpkg check-update
- Dad’s Master Bedroom Walk-in Closet
cmd reads and displays contents of Kernel Ring Buffer on the cmd line
dmesg
35 Dad’s Master Bedroom Bathroom multi jet shower
cmd creates swap space or block device or a file
mkswap
- Dad’s Master Bedroom Bathroom toilet
option to the tee cmd will cause the output to be concat on the end of the output file instead of overwriting the existing file contents
-a
- Dad’s Master Bedroom Bathroom window
file permissions belong to symbolic link
lrwxrwxrwx
- Dad’s Master Bedroom Bathroom Mirror
limitation of cut cmd
cannot reorder fields
- Dad’s Master Bedroom Bathroom sink
filesystems used on Linux root partitions
ext3
swap
- Dad’s Master Bedroom Door
cmd changes all occurrences of the word “bob” in file data to “Bob” and prints the result to standard output
sed ‘s/bob/Bob/g’ data
- 2nd Floor Main Staircase
cmd will change quota for specific user
edquota
- 1st landing floor step
when piping the output of find to xargs cmd when option to find is useful if the filenames have spaces in them
-print0
- Living Room fireplace
examples for bash flle globbing matches a file named root-can-do-this.txt when used in the directory holding that file
root*can?do-this.{txt,odt}
r[oOoO]t-can-do*.txt
{root,user,admin}-can-??-this.txt
- Living Room tapestry
produce following output
ps
- Living Room side table L
cmd load kernel module along with any required dependency
modprobe
- Living Room couch
what does cmd mount -a do
ensures that all file systems listed with the option auto in /etc/fstab are mounted
- Living Room Big WIndow behind couch
describe boot order
BIOS, bootloader, kernel, init system
- Living Room side table R
how is symbolic link called bar.conf pointing to foo.conf created
ln -s foo.conf bar.conf
- Door to Porch
file in /proc describes IRQs that are used by various kernel drivers
interrupts
- Porch Couch
cmd updates already installed RPM pckage rpmname
rpm -U rpmname
- Porch Desk
creating hard link to an ordinary file returns and error - what would be the reason
Source and target on different filesystems
- Porch TV
how many fields are in syntactically correct line of /etc/fstab
6
- Porch WIndow
cmds used to change metadata and options for ext3 filesystem
tune2fs
- Living Room Pub Set
what does the cmd grub-install /dev/sda do
GRUB installs all required files and configures the boot loader on device/dev/sda
- Living Room Chair 1
cmd sets stickybit
chmod +t /tmp
chmod 1775 /tmp
- Living Room Chair 2
cmd makes already defined variable TEST visible to new child processes
export TEST
57 Living Room Bookcase 1
settins for umask ensures that new files have default permissions rw-r——
0027
- Living Room Bookcase 2
apt-get cmd will install newest version of all currently installed packages
dist-upgrade
- Living Room Stereo Cabinet
what is true about command ending with a & character
command is run in background of the current shell
- Living Room TV
file from /proc file system contains a list of all currently mounted devices
mounts
61 Living Room Step Up to Kitchen Landing
cmd converts spaces in a file to tab characters and prints the result to std output
unexpand
- Breakfast Nook Table
cmd changes number of days before the ext3 filesystem on /dev/sda1 has run through a full filesystem check while booting
tune2fs -i 200 /dev/sda1
- Breakfast Nook Fish Tank
utility would be used to change how often a filesystem check is performed on ex2 filesystem without losing any data stored on that filesystem
tune2fs
- Breakfast Nook Phone
command lines create or in case it already exists, overwrites a file called data with output of ls
ls > data
- 1st floor Bathroom toilet
signal sent by kill cmd by default
SIGTERM(15)
- 1st floor Bathroom sink
program updates database that is used by locate command
updatedb
- 1st floor Bathroom Cabinet
cmd instructs SysVinit to reload its config file
telinit q
- Side door to outside
device file name for second partition on the only SCSI rive
/dev/sda2
- Kitchen Refrigeratior
cmd used to locate programs and their corresponding man pages and config files
whereis
- Kitchen Oven
cmd can be used to create new files that is 100kB in size
dd
- Kitchen Window
cmd changes the nice level of running process
renice
- Kitchen Sink
using reg expression which of the following characters match the beginning of a line
- Kitchen Toaster Oven
cmd makes /bin/foo executable by everyone but writeable only by its owner
chmod u=rwx,go=rx /bin/foo
- Kitchen Countertop
permissions and ownership should the file /etc/passwd have
-re-r–r–1 rootroot531 Jun 5 22:45 /etc/passwd
75 Kitchen Pantry
when choosing a partition scheme what directories could be considered for separate partitioins
/home
76 Dining Room Side Table
cmd will uninstall package but leave its config files in case the package is reinstalled
dpkg -r pkgname
77 Dining Room Table
modes of vi editor
mode
insert
command
78 Dining Room Chandileir
pressing Crl-C combo on keyboard will a cmd is executing in the foreground sends this signal code
2(SIGINT)
79 Dining Room Window
purpos of FHS
distribution neutral description of locations of files and directories
80 Dining Room Bar
Where does BIOS search for bootloader
on all connected storage media in the defined device boot order
- Vestibule Coat Closet
purpose of xargs
reads standard input and builds up cmd lines to execute
- Front Door
cmd enables setuid (suid) permissions on executable /bin/foo
chmod 4755 /bin/foo
- Front Steps
sys config file named_____ commonly used to set the default runlevel
/etc/inittab
- cobblestone path
cmd used to display inode number of given file
ls
- Sidewalk
moving data to new filesystem how can former path of data be kept intact in order to avoid reconfiguration of existing applications
by creating symbolic link from the old to the new path of the data
by mounting the new filesystem on the original path of the data
- Driveway
type of filesystem created by mkfs when it is executed with the block device name only and without any additional parameters
ext2
- Side Porch
in bash inserting 2>$1 after a command redirects
standard output to standard error