CCTC EXAM 2 MOCK TEST WITH ANSWER
RATIONALES 2026
◉ 2.1 Where is command history saved to in bash?.
Answer: - command history is saved to ~./.bash_history, accessible
by pressing the up arrow key
- writes history from memory (HISTSIZE) to disk (HISTFILESIZE)
when close the shell
◉ 2.1 How to create, read, copy, remove, change ownership, change
permissions in bash and IMP commands.
Answer: create: touch
read: cat
copy: cp
remove: rm
change ownership: chown
change permissions: chmod
list: ls
list w/ more detail on a file : ls -l FILENAME
ps : process list
,system informaion (kernal/hardware) : uname -a
help: --help
go to the home: cd
show current directory: pwd
show date: date
who am I logged in as: whoami
ping host: ping
get whois infor for a domain: whois domain
list netwoor connections: netstat
◉ order of evaluation in bash.
Answer: redirection
aliases
expansion
command substitution
shell
◉ 2.2 Environment initialization.
Answer: -l logs in without a GUI
-i interactive mode with a GUI
, During Initialization of a shell environment the sources for the
environment are pulled from the following:
/etc/profile
(home directory ~) ~/.bash_login, ~/.bash_profile, ~/.profile
◉ 2.3 redirection.
Answer: used to put output into a file or variable
> writes to
>> appends to
mkdir = make a directory
◉ 2.3 Piping.
Answer: used to put output of a process into another process
[process 1] | [process2]
named pipes: info remains in the named pipe until system is shut
down
mkfifo [pipeName]
EX: ls -l text.txt | grep "Modify"
◉ 2.4 bash boolean logic.
RATIONALES 2026
◉ 2.1 Where is command history saved to in bash?.
Answer: - command history is saved to ~./.bash_history, accessible
by pressing the up arrow key
- writes history from memory (HISTSIZE) to disk (HISTFILESIZE)
when close the shell
◉ 2.1 How to create, read, copy, remove, change ownership, change
permissions in bash and IMP commands.
Answer: create: touch
read: cat
copy: cp
remove: rm
change ownership: chown
change permissions: chmod
list: ls
list w/ more detail on a file : ls -l FILENAME
ps : process list
,system informaion (kernal/hardware) : uname -a
help: --help
go to the home: cd
show current directory: pwd
show date: date
who am I logged in as: whoami
ping host: ping
get whois infor for a domain: whois domain
list netwoor connections: netstat
◉ order of evaluation in bash.
Answer: redirection
aliases
expansion
command substitution
shell
◉ 2.2 Environment initialization.
Answer: -l logs in without a GUI
-i interactive mode with a GUI
, During Initialization of a shell environment the sources for the
environment are pulled from the following:
/etc/profile
(home directory ~) ~/.bash_login, ~/.bash_profile, ~/.profile
◉ 2.3 redirection.
Answer: used to put output into a file or variable
> writes to
>> appends to
mkdir = make a directory
◉ 2.3 Piping.
Answer: used to put output of a process into another process
[process 1] | [process2]
named pipes: info remains in the named pipe until system is shut
down
mkfifo [pipeName]
EX: ls -l text.txt | grep "Modify"
◉ 2.4 bash boolean logic.