Courseiva

CCNA Finding Your Way ON A Linux System Questions

45 questions · Finding Your Way ON A Linux System · All types, answers revealed

1
MCQmedium

Which command is used to view the contents of a file one screen at a time?

A.less
B.head
C.more
D.cat
AnswerA

less is the standard, more powerful pager.

Why this answer

The 'less' command is a terminal pager that allows forward and backward navigation through text files.

2
MCQeasy

To navigate from your current directory to your home directory regardless of your current location, which command is most efficient?

A.cd ..
B.cd ~
C.cd /
D.cd /home
AnswerB

The tilde represents the home directory path.

Why this answer

The cd command without arguments or with the tilde character defaults to the user's home directory.

3
MCQhard

You are searching for a command that deals with 'groups' and want to see all manual pages that mention this term. Which command is most appropriate?

A.apropos groups
B.whatis groups
C.info groups
D.man -a groups
AnswerA

apropos searches descriptions for the keyword.

Why this answer

apropos is specifically designed to search for keywords across all man page descriptions.

4
MCQmedium

What does the 'cat' command do when provided with multiple filenames as arguments?

A.It displays only the first file
B.It displays the contents of all files sequentially
C.It compares them
D.It merges them into one file
AnswerB

cat concatenates and displays the streams.

Why this answer

The cat command reads the files in the order they are listed and concatenates them to the standard output.

5
Multi-Selecthard

Which THREE of the following commands are used for file manipulation?

Select 3 answers
A.cp
B.man
C.pwd
D.rm
E.mv
AnswersA, D, E

Copies files.

Why this answer

cp, mv, and rm are the fundamental file manipulation commands.

6
MCQhard

You need to see the last 20 lines of a file named 'access.log'. Which command is the most appropriate?

A.cat -n 20 access.log
B.less -n 20 access.log
C.head -n 20 access.log
D.tail -n 20 access.log
AnswerD

tail displays the end of the file.

Why this answer

The tail command with the -n option allows specifying the number of lines to display from the end of the file.

7
MCQmedium

You want to delete a file but you are worried about accidentally deleting the wrong one. Which flag should you use with 'rm' for confirmation?

A.rm -f
B.rm -v
C.rm -i
D.rm -R
AnswerC

-i enables interactive prompting.

Why this answer

The -i flag makes the rm command interactive, asking for confirmation before removing each file.

8
Multi-Selecthard

Which TWO of the following are valid ways to search for files?

Select 2 answers
A.man
B.cat
C.find
D.grep
E.locate
AnswersC, E

Real-time filesystem search.

Why this answer

find and locate are the primary search tools.

9
Multi-Selecteasy

Which TWO of the following commands can be used to display the contents of a text file?

Select 2 answers
A.cd
B.mkdir
C.cat
D.less
E.mv
AnswersC, D

cat prints file content to stdout.

Why this answer

cat and less are both common tools for reading file contents.

10
MCQmedium

When using the 'man' command, how do you navigate to the next page of the manual entry?

A.Enter
B.Page Up
C.Right Arrow
D.Spacebar
AnswerD

Spacebar scrolls forward one full page.

Why this answer

The spacebar is the standard key to scroll forward one full screen in most pager applications, including the man viewer.

11
Multi-Selectmedium

Which THREE of the following represent ways to refer to the home directory?

Select 3 answers
A.~
B...
C.$HOME
D./home/user
E./
AnswersA, C, D

Tilde is the shell alias for home.

Why this answer

~, $HOME, and the absolute path are all ways to reference home.

12
MCQmedium

You want to delete a directory named 'temp_backup' that contains several files. Which command will successfully remove it and its contents?

A.rm -r temp_backup
B.rm temp_backup
C.rmdir temp_backup
D.rm -f temp_backup
AnswerA

-r allows for recursive deletion of directory trees.

Why this answer

The -r (recursive) flag is required for rm to delete directories and their contents.

13
MCQhard

Which command would you use to list files in long format, sorted by modification time, with the newest files appearing first?

A.ls -lt
B.ls -lr
C.ls -Rlt
D.ls -ltr
AnswerD

-l is long, -t is sort by time, -r reverses order.

Why this answer

The -l (long), -t (time), and -r (reverse) flags together achieve this.

14
MCQmedium

How do you rename a file named 'oldname' to 'newname' using the command line?

A.rn oldname newname
B.ren oldname newname
C.cp oldname newname
D.mv oldname newname
AnswerD

mv renames a file by moving it to the same directory with a new name.

Why this answer

The mv (move) command is used for both moving and renaming files.

15
MCQeasy

Which command is used to clear the terminal screen?

A.clean
B.clear
C.wipe
D.reset
AnswerB

clear empties the terminal display.

Why this answer

The clear command wipes the current terminal output.

16
MCQeasy

Which shell variable typically contains the directories searched for command executables?

A.$SHELL
B.$USER
C.$PATH
D.$HOME
AnswerC

$PATH stores the location of executables.

Why this answer

The PATH variable holds the colon-separated list of directories the shell searches for commands.

17
MCQhard

You need to move a file named 'data.txt' from the current directory to '/var/logs' but want to be prompted if a file with the same name already exists in the destination. Which option should you add to 'mv'?

A.mv -i
B.mv -n
C.mv -f
D.mv -v
AnswerA

-i enables interactive mode to prompt before overwrite.

Why this answer

The -i (interactive) flag prompts the user before overwriting existing files.

18
Multi-Selecteasy

Which TWO of the following are valid ways to get help on a Linux system?

Select 2 answers
A.search
B.man
C.findhelp
D.help
E.explain
AnswersB, D

man pages are standard.

Why this answer

The man and info commands are the primary documentation systems.

19
MCQhard

You are currently in a directory and want to find files ending in '.conf' within the current folder and its subfolders. Which command is correct?

A.grep "*.conf"
B.search *.conf
C.find -name "*.conf"
D.ls *.conf
AnswerC

find searches recursively by default.

Why this answer

The find command is the tool for searching the filesystem based on criteria like name.

20
Multi-Selectmedium

Which TWO of the following commands help you move within the directory structure?

Select 2 answers
A.cat
B.ls
C.cd
D.mv
E.popd
AnswersC, E

Changes working directory.

Why this answer

cd and popd allow moving between directories.

21
Multi-Selectmedium

Which THREE of the following commands are used for viewing file metadata or status?

Select 3 answers
A.ls -l
B.stat
C.file
D.cat
E.cd
AnswersA, B, C

Shows permissions and owner.

Why this answer

ls, stat, and file all provide information about files.

22
Multi-Selecteasy

Which THREE of the following are components of a standard Linux file path?

Select 3 answers
A.Root directory (/)
B.Terminal color
C.User password
D.Directory names
E.Filename
AnswersA, D, E

The starting point.

Why this answer

Root, directories, and filenames are components of a path.

23
MCQeasy

You are browsing a directory and need to see hidden files alongside regular files. Which command achieves this?

A.ls -R
B.ls -h
C.ls -a
D.ls -l
AnswerC

The -a option includes files starting with a dot.

Why this answer

The -a (all) flag is required for ls to display hidden files starting with a dot.

24
MCQmedium

You have created a script but it is not executable. Which command should you use to give the owner execute permissions?

A.chown u+x
B.chgrp u+x
C.chmod u+x
D.chperm u+x
AnswerC

u+x grants execute permissions to the user.

Why this answer

The chmod command is used to change file permissions, and u+x adds execute permission for the user.

25
MCQmedium

You need to append the output of a command to an existing file without overwriting it. Which operator should you use?

A.|
B.>
C.&
D.>>
AnswerD

This appends to the file.

Why this answer

The >> operator appends output to a file.

26
MCQhard

You are trying to find the location of a binary file, specifically the 'ls' command. Which command is best suited for this?

A.find
B.locate
C.which
D.whereis
AnswerC

which returns the pathname of the executable.

Why this answer

The 'which' command finds the location of an executable in the user's PATH.

27
MCQhard

You want to create a symbolic link named 'link_to_file' that points to 'original_file'. Which command is correct?

A.link original_file link_to_file
B.ln -h original_file link_to_file
C.ln original_file link_to_file
D.ln -s original_file link_to_file
AnswerD

-s specifies a symbolic link.

Why this answer

The ln -s command is used to create symbolic links.

28
Multi-Selectmedium

Which TWO of the following flags can be used with 'ls' to modify its output?

Select 2 answers
A.-o
B.-a
C.-z
D.-x
E.-l
AnswersB, E

-a shows hidden files.

Why this answer

-l and -a are very common flags for ls.

29
MCQmedium

What is the purpose of the '..' notation in a file path?

A.Parent directory
B.Current directory
C.Root directory
D.Home directory
AnswerA

.. references the directory above the current one.

Why this answer

.. refers to the parent directory of the current directory.

30
MCQmedium

What is the purpose of the 'tee' command?

A.To join files
B.To split output to file and screen
C.To format output
D.To filter output
AnswerB

tee acts like a T-junction in a pipe.

Why this answer

The tee command reads from standard input and writes to both standard output and one or more files.

31
MCQeasy

Which command provides a brief summary of what a specific command does without opening the entire man page?

A.info
B.whatis
C.man -d
D.apropos
AnswerB

whatis displays a one-line summary.

Why this answer

The whatis command provides a one-line description for a command name.

32
MCQmedium

You are using the 'less' command to view a large log file. Which key do you press to search forward for a specific string?

A.?
B./
C.q
D.n
AnswerB

The forward slash prompts for a regex to search forward.

Why this answer

The forward slash (/) character is the standard key to initiate a forward search in less.

33
Multi-Selecthard

Which TWO of the following are valid ways to create a directory?

Select 2 answers
A.touch
B.install -d
C.mkdir
D.ln
E.cp -d
AnswersB, C

install can create directory structures.

Why this answer

mkdir is the standard command, and install with -d is a less common but valid method.

34
MCQmedium

When using 'man', what does the section number '5' refer to?

A.User commands
B.File formats
C.System calls
D.Kernel routines
AnswerB

Section 5 defines file formats.

Why this answer

Section 5 of the manual pages is reserved for file formats and conventions.

35
MCQmedium

You need to search for a specific command description within the manual pages using a keyword. Which command should you use?

A.man -s
B.man -f
C.man -k
D.help
AnswerC

-k searches through the short descriptions of man pages.

Why this answer

The man -k command (or apropos) searches the manual page descriptions for keywords.

36
MCQeasy

Which of the following commands is used to create an empty file or update the timestamp of an existing file?

A.cp
B.touch
C.mkdir
D.mv
AnswerB

touch creates files or updates timestamps.

Why this answer

The touch command creates an empty file if it does not exist or updates access/modification times if it does.

37
Multi-Selecteasy

Which TWO of the following are valid ways to list directory contents?

Select 2 answers
A.pwd
B.cd
C.ls
D.cat
E.dir
AnswersC, E

The standard command.

Why this answer

ls and dir are both valid commands for listing files.

38
MCQmedium

You are currently in '/home/user/docs' and need to move to '/etc'. Which command is correct?

A.cd ~/etc
B.cd ../../etc
C.cd /etc
D.cd etc
AnswerC

Absolute paths start with /.

Why this answer

cd /etc uses an absolute path to jump directly to the target directory.

39
Multi-Selecthard

Which THREE of the following are types of manual page sections?

Select 3 answers
A.Network protocols (10)
B.User commands (1)
C.System calls (2)
D.File formats (5)
E.Kernel hardware (20)
AnswersB, C, D

Section 1.

Why this answer

User commands, system calls, and file formats are core man page sections.

40
MCQmedium

You are copying a directory named 'source' to 'destination' and want to ensure all subdirectories and file attributes are preserved. Which flag is essential?

A.cp -a
B.cp -p
C.cp -v
D.cp -r
AnswerA

-a (archive) preserves everything and is recursive.

Why this answer

The -a (archive) flag is the most efficient way to preserve attributes, permissions, and handle recursive copies.

41
MCQeasy

You are logged into a terminal and want to identify your current working directory. Which command should you execute?

A.pwd
B.whoami
C.ls
D.cd
AnswerA

pwd prints the name of the current working directory.

Why this answer

The pwd command displays the absolute path of the directory you are currently in.

42
MCQeasy

To see the contents of a directory, which command is standard?

A.ls
B.dir
C.list
D.cat
AnswerA

ls is the standard tool for listing contents.

Why this answer

The ls command is the standard tool for listing directory contents.

43
Multi-Selectmedium

Which TWO of the following options can be used with 'rm' to ensure safe operation?

Select 2 answers
A.-I
B.-v
C.-r
D.-f
E.-i
AnswersA, E

Prompts once if deleting more than 3 files.

Why this answer

-i and -I provide safety measures during deletion.

44
MCQeasy

What is the primary difference between 'man' pages and 'info' pages?

A.man is graphical, info is text-based
B.man pages are obsolete
C.man is for system files, info is for users
D.info contains more detailed, hyperlinked documentation
AnswerD

Info is designed as a hypertext system.

Why this answer

Info pages are generally more detailed, hierarchical, and often contain hyperlinks, whereas man pages are typically concise, technical summaries.

45
Multi-Selectmedium

Which THREE of the following are valid directory navigation commands?

Select 3 answers
A.ls
B.mkdir
C.pushd
D.pwd
E.cd
AnswersC, D, E

pushd changes directory while saving the location on a stack.

Why this answer

cd, pwd, and pushd are all used for directory management.

Ready to test yourself?

Try a timed practice session using only Finding Your Way ON A Linux System questions.