21 Questions
What should you set to prevent disconnections when using the Windows version of PuTTY?
The seconds between keepalives to 55
What Unix command line deletes a directory and everything inside it?
rm -r dir
Which CTRL key will interrupt the command 'sleep 60' and take you back to the command prompt?
^C
If you type the command 'touch foo ; mkdir bar ; mv foo mt/bar', what is true about the directory mt?
It is still empty
What happens after the command 'mv cow/dog cow/././cat'?
The directory cow now contains only a file named cat
If my current directory is /usr, which of these pathnames is equivalent to the pathname /usr/x/y/z?
x/./y/z
What is the function of the 'apropos' command in Unix?
To find a keyword in the man pages
What is the function of the 'grep' command in Unix?
To search for a string in a file
How many arguments and options are there to the command: ls -lid /p
Two command line arguments, one of which contains three bundled options.
If I am in directory /home/me and mt is an empty sub-directory, what is true after this command line: touch foo ; mkdir bar ; mv foo bar/mt
The directory mt is still empty
What is true after the command line touch ./mt/fil ; mv mt/./fil mt/../../me/./y is executed?
The directory mt is still empty
Which of these is the correct CLS name to use when on-campus (or via VPN)?
cst8207-alg.idallen.ca
Simplify this pathname: /home/me/../you/../../etc/../home/me/../you/../me/../..
/
What command would you use to find the string tony in the file /etc/passwd?
grep tony /etc/passwd
If my current directory is /lib, which of these pathnames is equivalent to the pathname /lib/x/y?
./x/y
If my current directory is /etc, which of these pathnames is equivalent to the file name /etc/passwd?
passwd
What would you see if you typed this command: cat /foo
The contents of the file foo located in the ROOT directory
What happens after the command mv foo/me foo/bar is executed?
The command fails because the name me does not exist
If /bin/bash is a file name, which pathname almost always leads to the same file?
./bin/../../bin/bash
To change your own account password, use this exact command line:
$ passwd
What happens when you try to change to the parent directory of ROOT, e.g. cd / ; cd..
the shell current directory is still ROOT; no change
Study Notes
Linux File System and Commands
- The
touch
command creates an empty file. - The
mv
command moves or renames a file or directory. - The
mkdir
command creates a new directory. - The
rm
command deletes a file or directory. - The
cp
command copies a file or directory. - The
grep
command searches for a pattern in a file or files. - The
find
command searches for a file or files based on various criteria. - The
passwd
command changes a user's login password.
Pathnames and Directories
- A pathname is a sequence of directory names separated by slashes.
- The
.
refers to the current working directory. - The
..
refers to the parent directory. - The
~
refers to the user's home directory. - The
/
at the beginning of a pathname refers to the root directory. - A directory can be referred to by its absolute pathname or its relative pathname.
Changing Directories
- The
cd
command changes the current working directory. - The
cd
command with no arguments changes to the user's home directory. - The
cd /
command changes to the root directory. - The
cd ..
command changes to the parent directory.
File System Hierarchy
- The root directory is the top-most directory in the file system hierarchy.
- The
/home
directory contains user home directories. - The
/etc
directory contains system configuration files. - The
/bin
directory contains executable files. - The
/lib
directory contains library files.
Command Line Options
- Square brackets
[]
in a command synopsis indicate optional arguments. - The
apo
command displays a list of utilities available for compiling programs. - The
man
command displays the manual for a command or function.
Using PuTTY
- To prevent disconnections when using PuTTY, set the seconds between keepalives to 55.
- The
sleep
command pauses execution for a specified amount of time. - The
^C
key interrupts a command and returns to the command prompt.
Miscellaneous
- The
_synopsis
section of a manual page describes the command syntax. - The
CL
command line interface is used to interact with the operating system. - The
HOME
directory is the user's home directory.
Test your knowledge of Linux file system and commands, including creating files and directories, moving and copying files, searching for patterns, and more.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free