SlideShare une entreprise Scribd logo
1  sur  7
Linux Midterm Exam
Your quiz has been submitted successfully.
Question 1
I'm logged into Linux as user 'pc', and I want to move the file '~/Videos/one.mpg' to "/usr/bin". I
try:
mv ~/Videos/one.mpg /usr/bin
but I get an error. Why, and what command would work? (select the best answer)
It should work, using the -p switch.
/usr/bin is owned by root, so you need to run: sudo mv ~/Videos/one.mpg /usr/bin
It didn't work because your command is wrong, it should be:
mv /usr/bin /Videos/one.mpg
It didn't work because your command is wrong, it should be:
mv /Videos/one.mpg /usr/bin
Question 2
I have three files named file1, file2, and file3, and I want to put them into a single file called
'bigfile.txt'. How can I do this?
cat file1 file2 file3 > onebigfile
less < file1 file2 file3
cat file1 file2 file3 < bigfile
cat file1 file2 file3 > bigfile.txt
Question 3
The command line utility clear:
Clears the terminal screen
Sends packets to a remote system
Clears your history
Clears a user's password
Question 4
I want to uncompress and unarchive the file:
hello1.tar.bz2
What command would do this?
tar xzf hello1.tar.bz2
tar xjf hello.tar.bz2
gunzip hello1.tar.bz2
tar xjf hello1.tar.bz2
Question 5
I have a file named 'hello.tar.gz.' I want to uncompress and unarchive the file. Which command
would do this?
1) tar xfz hello.tar.gz
2) Tar xjf hello.tar.gz
3) tar xfj hello.tar.gz
4) tar fz hello.tar.gz
Question 6
I run 'history' and see the following:
....
492 ls -al
493 clear
494 sudo cat /etc/passwd
495 ls -al
496 clear
I want to rerun the command:
sudo cat /etc/passwd
Which command would do this?
1) !sudo cat /etc/passwd
2) !!
3) 494$
4) !494
Question 7
I have a file named 'bigfile' in ~. I want to rename the file to 'oldfile', and I want to move it to
~/Downloads. The command that would do this is:
1) mv bigfile oldfile < ~/Documents
2) mv ~/bigfile ~/Documents/oldfile
3) mv ~/bigfile ~/Downloads/oldfile
4) rename bigfile oldfile | ~/Documents
Question 8
The 'who' command ...
1) Displays only power users
2) Doesn't exist
3) Displays who I am (my user ID)
4) Displays everyone who is logged in
Question 9
| (pipe) is used for what?
1) Is used to create little walls between things in Linux
2) Is used to concatenate files
3) Is used to chain commands together
4) Is always used with find or grep.
Question 10
Which of the following commands would find empty files (not directories) under /var/log only?
sudo find /var -type f -empty
sudo find /etc -type d -exec empty {} ;
sudo find /var/log -type f -empty
sudo find /etc -type f
Question 11
I want to find files under / that have the characters 'DSC' in their content, case insensitive. Which
command would do this?
sudo grep -iname 'DsC'
sudo find ~ -type f -name 'DSC*'
sudo find / -type f -iname '*dsc*'
sudo grep -r / 'DSC'
Question 12
I'm in ~. I want to create a tar file named "mylargedocs.tar" that contains all files in ~ ending in
.doc. What command would I run?
tar cf mydocs.tar *.doc
tar cf mylargedocs.tar *.doc
sudo tar cvfz mydocs.tar *.doc
tar xvf mydocs.tar *.doc
Question 13
I want to compress the file 'moNster.tar'. Which command would I use?
bzip2 moNster.tar
bunzip moNster.tar
tar -xzvf moNster.tar
bzip2 monster.tar
Question 14
I want to find all files under ~ that were modified less than 10 minutes ago. The command I run
would be:
find ~ -type f -cmin -10
True
False
Question 15
I want to search for files under ~ that contain the keyword "Flumox," and to redirect that output
to a new file called "Flumox.txt" under ~/Documents. The command would be:
find -name 'Flumox' > Flumox
grep -R "Flumox" ~ > ~/Flumox.txt
grep -R "Flumox" ~ > ~/Documents/Flumox.txt
grep -R "Flumox" ~ > /Flumox.txt
Question 16
I'm in the following directory:
~/Docs/2015/dsc/linux/spring/night
If issue this command:
cd ../../../..
In what directory would I be?
~/Docs/2015/
~/Docs/2015/dsc/linux/
~/Docs/2015/dsc/
~/Docs/2012/
Question 17
I'm in my home directory and want to create the following directory hierarchy with one
command:
~/calculus/homework/june/2012
Which command would do this?
mkdir -r calculus/homework/june/2012
mkdir -p /calculus/homework/june/2012
mdir -p calculus/homework/june/2012
mkdir -p calculus/homework/june/2012
Question 18
I'm in the directory:
/var/log/mail/map/june/2012/calculus/hard/problems/yikes/do/not/want/to/fail/this/class/again
I 'cd' back to my home directory using 'cd ~'.
Now I want to flip BACK to the preceding directory (/var/log/mail, etc.).
What's the fastest way to do that?
cd
/ var/log/mail/map/june/2012/calculus/hard/problems/yikes/do/not/want/to/fail/this/class/agai
n
cd ~
cd -
cd ../../../../../../../../../../../../../../../
Question 19
I want to install the program "ruprecht" under Mint. Easiest way to do that is:
Can't be done in Linux.
sudo atitude install ruprecht
sudo aptitude install ruprecht
aptitude install ruprecht
Question 20
I want a long listing of all files, including hidden files, in all directories residing under
~/POWER, and I want to save it to a file called 'myfiles'. What command would do this?
ls -alR ~/POWER > myfiles
sudo ls ~/POWER < myfiles
ls -alR ~ > myfiles
ls > files > ~/POWER
Question 21
I want to update my system with the most recent packages. I do that with:
su, su, sudio safe-upgrade
aptitude update && atitude safe-upgrade
atitutde update
atitude safe-upgarde
sudo aptitude update && sudo aptitude safe-upgrade
Question 22
I can't remember the command to delete a directory. A good way to find commands that have
either the word 'delete' in it, or in the description, would be to run:
delete --help
find / -name delete
apropos delete
man delete
Question 23
I want to know what devices are mounted on my system. The best way to find out is to run:
umount
dmesg | grep -exec sort {} ;
sufo fdisk -l
mount
Question 24
I want to find all regular files in my /var/log/mail directory with a '*.doc' extension that are
empty. What command would do this?
find /var/log/mail -name '*.txt'
sudo find /var/log/mail -type f -name '*.doc' -empty
find / -type f -name '*.txt' -empty
sudo find /var/log/mail -type f -name '*.txt' -empty
Question 25
I can't remember how to create a series of nested directories using one command, but I remember
that 'mkdir' is the command. The BEST way to find is the answer is to use (SELECT THE
BEST ANSWER). :)
'Facebook" Prof Craiger.
Email Prof Craiger at his DSC email address.
Use Twitter to ask Prof Craiger.
man mkdir

Contenu connexe

Tendances

Useful Linux and Unix commands handbook
Useful Linux and Unix commands handbookUseful Linux and Unix commands handbook
Useful Linux and Unix commands handbookWave Digitech
 
[PDF] 2021 Termux basic commands list
[PDF] 2021 Termux basic commands list [PDF] 2021 Termux basic commands list
[PDF] 2021 Termux basic commands list nisivaasdfghj
 
Linux or unix interview questions
Linux or unix interview questionsLinux or unix interview questions
Linux or unix interview questionsTeja Bheemanapally
 
DWARF Data Representation
DWARF Data RepresentationDWARF Data Representation
DWARF Data RepresentationWang Hsiangkai
 
Basic command ppt
Basic command pptBasic command ppt
Basic command pptRohit Kumar
 
Linux Administration
Linux AdministrationLinux Administration
Linux AdministrationHarish1983
 
50 most frequently used unix linux commands (with examples)
50 most frequently used unix   linux commands (with examples)50 most frequently used unix   linux commands (with examples)
50 most frequently used unix linux commands (with examples)Rodrigo Maia
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic CommandsHanan Nmr
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux Harish R
 
Vim Editor And Basic Scripting (Ch-7)
Vim Editor And Basic Scripting (Ch-7)Vim Editor And Basic Scripting (Ch-7)
Vim Editor And Basic Scripting (Ch-7)MohsinHusenManasiya
 
Faster packet processing in Linux: XDP
Faster packet processing in Linux: XDPFaster packet processing in Linux: XDP
Faster packet processing in Linux: XDPDaniel T. Lee
 
Basic commands of linux
Basic commands of linuxBasic commands of linux
Basic commands of linuxshravan saini
 
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSSupercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSCloudLinux
 
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...Edureka!
 

Tendances (20)

Useful Linux and Unix commands handbook
Useful Linux and Unix commands handbookUseful Linux and Unix commands handbook
Useful Linux and Unix commands handbook
 
[PDF] 2021 Termux basic commands list
[PDF] 2021 Termux basic commands list [PDF] 2021 Termux basic commands list
[PDF] 2021 Termux basic commands list
 
Linux or unix interview questions
Linux or unix interview questionsLinux or unix interview questions
Linux or unix interview questions
 
DWARF Data Representation
DWARF Data RepresentationDWARF Data Representation
DWARF Data Representation
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
 
50 most frequently used unix linux commands (with examples)
50 most frequently used unix   linux commands (with examples)50 most frequently used unix   linux commands (with examples)
50 most frequently used unix linux commands (with examples)
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux
 
MySQL Cheat Sheet
MySQL Cheat SheetMySQL Cheat Sheet
MySQL Cheat Sheet
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Filepermissions in linux
Filepermissions in linuxFilepermissions in linux
Filepermissions in linux
 
Vim Editor And Basic Scripting (Ch-7)
Vim Editor And Basic Scripting (Ch-7)Vim Editor And Basic Scripting (Ch-7)
Vim Editor And Basic Scripting (Ch-7)
 
Faster packet processing in Linux: XDP
Faster packet processing in Linux: XDPFaster packet processing in Linux: XDP
Faster packet processing in Linux: XDP
 
Shell programming
Shell programmingShell programming
Shell programming
 
F strings
F stringsF strings
F strings
 
Basic commands of linux
Basic commands of linuxBasic commands of linux
Basic commands of linux
 
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSSupercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
 
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
 
Command-Line 101
Command-Line 101Command-Line 101
Command-Line 101
 

Similaire à Linux midterm quiz

Basic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersBasic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersDevanand Gehlot
 
Code tacoma command_line
Code tacoma command_lineCode tacoma command_line
Code tacoma command_lineAndrea Urban
 
Sls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In PracticeSls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In PracticeQasim Khawaja
 
Using linux in schools
Using linux in schools Using linux in schools
Using linux in schools shinigami-99
 
Introduction to the linux command line.pdf
Introduction to the linux command line.pdfIntroduction to the linux command line.pdf
Introduction to the linux command line.pdfCesleySCruz
 
Introduction to linux day-3
Introduction to linux day-3Introduction to linux day-3
Introduction to linux day-3Gourav Varma
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1Lilesh Pathe
 
bash_1_2021-command line introduction.pdf
bash_1_2021-command line introduction.pdfbash_1_2021-command line introduction.pdf
bash_1_2021-command line introduction.pdfMuhammadAbdullah311866
 
Most frequently used unix commands for database administrator
Most frequently used unix commands for database administratorMost frequently used unix commands for database administrator
Most frequently used unix commands for database administratorDinesh jaisankar
 
Rhel 6.2 complete ebook
Rhel 6.2  complete ebookRhel 6.2  complete ebook
Rhel 6.2 complete ebookYash Gulati
 
Linux_Commands.pdf
Linux_Commands.pdfLinux_Commands.pdf
Linux_Commands.pdfMarsMox
 
Linux for CS Majors
Linux for CS MajorsLinux for CS Majors
Linux for CS Majorsworr1244
 

Similaire à Linux midterm quiz (20)

Unix for Librarians
Unix for LibrariansUnix for Librarians
Unix for Librarians
 
Basic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersBasic shell commands by Jeremy Sanders
Basic shell commands by Jeremy Sanders
 
Code tacoma command_line
Code tacoma command_lineCode tacoma command_line
Code tacoma command_line
 
Linux
LinuxLinux
Linux
 
Sls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In PracticeSls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In Practice
 
Rhel1
Rhel1Rhel1
Rhel1
 
Using linux in schools
Using linux in schools Using linux in schools
Using linux in schools
 
Introduction to the linux command line.pdf
Introduction to the linux command line.pdfIntroduction to the linux command line.pdf
Introduction to the linux command line.pdf
 
Introduction to linux day-3
Introduction to linux day-3Introduction to linux day-3
Introduction to linux day-3
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
 
bash_1_2021-command line introduction.pdf
bash_1_2021-command line introduction.pdfbash_1_2021-command line introduction.pdf
bash_1_2021-command line introduction.pdf
 
Most frequently used unix commands for database administrator
Most frequently used unix commands for database administratorMost frequently used unix commands for database administrator
Most frequently used unix commands for database administrator
 
Unix_QT.ppsx
Unix_QT.ppsxUnix_QT.ppsx
Unix_QT.ppsx
 
Unix_QT.ppsx
Unix_QT.ppsxUnix_QT.ppsx
Unix_QT.ppsx
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
Rhel 6.2 complete ebook
Rhel 6.2  complete ebookRhel 6.2  complete ebook
Rhel 6.2 complete ebook
 
Examples -partII
Examples -partIIExamples -partII
Examples -partII
 
Linux_Commands.pdf
Linux_Commands.pdfLinux_Commands.pdf
Linux_Commands.pdf
 
Linux for CS Majors
Linux for CS MajorsLinux for CS Majors
Linux for CS Majors
 

Dernier

What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 

Dernier (20)

What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 

Linux midterm quiz

  • 1. Linux Midterm Exam Your quiz has been submitted successfully. Question 1 I'm logged into Linux as user 'pc', and I want to move the file '~/Videos/one.mpg' to "/usr/bin". I try: mv ~/Videos/one.mpg /usr/bin but I get an error. Why, and what command would work? (select the best answer) It should work, using the -p switch. /usr/bin is owned by root, so you need to run: sudo mv ~/Videos/one.mpg /usr/bin It didn't work because your command is wrong, it should be: mv /usr/bin /Videos/one.mpg It didn't work because your command is wrong, it should be: mv /Videos/one.mpg /usr/bin Question 2 I have three files named file1, file2, and file3, and I want to put them into a single file called 'bigfile.txt'. How can I do this? cat file1 file2 file3 > onebigfile less < file1 file2 file3 cat file1 file2 file3 < bigfile cat file1 file2 file3 > bigfile.txt Question 3 The command line utility clear: Clears the terminal screen
  • 2. Sends packets to a remote system Clears your history Clears a user's password Question 4 I want to uncompress and unarchive the file: hello1.tar.bz2 What command would do this? tar xzf hello1.tar.bz2 tar xjf hello.tar.bz2 gunzip hello1.tar.bz2 tar xjf hello1.tar.bz2 Question 5 I have a file named 'hello.tar.gz.' I want to uncompress and unarchive the file. Which command would do this? 1) tar xfz hello.tar.gz 2) Tar xjf hello.tar.gz 3) tar xfj hello.tar.gz 4) tar fz hello.tar.gz Question 6 I run 'history' and see the following: .... 492 ls -al 493 clear 494 sudo cat /etc/passwd 495 ls -al 496 clear I want to rerun the command: sudo cat /etc/passwd Which command would do this?
  • 3. 1) !sudo cat /etc/passwd 2) !! 3) 494$ 4) !494 Question 7 I have a file named 'bigfile' in ~. I want to rename the file to 'oldfile', and I want to move it to ~/Downloads. The command that would do this is: 1) mv bigfile oldfile < ~/Documents 2) mv ~/bigfile ~/Documents/oldfile 3) mv ~/bigfile ~/Downloads/oldfile 4) rename bigfile oldfile | ~/Documents Question 8 The 'who' command ... 1) Displays only power users 2) Doesn't exist 3) Displays who I am (my user ID) 4) Displays everyone who is logged in Question 9 | (pipe) is used for what? 1) Is used to create little walls between things in Linux 2) Is used to concatenate files 3) Is used to chain commands together 4) Is always used with find or grep. Question 10 Which of the following commands would find empty files (not directories) under /var/log only? sudo find /var -type f -empty sudo find /etc -type d -exec empty {} ; sudo find /var/log -type f -empty
  • 4. sudo find /etc -type f Question 11 I want to find files under / that have the characters 'DSC' in their content, case insensitive. Which command would do this? sudo grep -iname 'DsC' sudo find ~ -type f -name 'DSC*' sudo find / -type f -iname '*dsc*' sudo grep -r / 'DSC' Question 12 I'm in ~. I want to create a tar file named "mylargedocs.tar" that contains all files in ~ ending in .doc. What command would I run? tar cf mydocs.tar *.doc tar cf mylargedocs.tar *.doc sudo tar cvfz mydocs.tar *.doc tar xvf mydocs.tar *.doc Question 13 I want to compress the file 'moNster.tar'. Which command would I use? bzip2 moNster.tar bunzip moNster.tar tar -xzvf moNster.tar bzip2 monster.tar Question 14 I want to find all files under ~ that were modified less than 10 minutes ago. The command I run would be: find ~ -type f -cmin -10 True False Question 15
  • 5. I want to search for files under ~ that contain the keyword "Flumox," and to redirect that output to a new file called "Flumox.txt" under ~/Documents. The command would be: find -name 'Flumox' > Flumox grep -R "Flumox" ~ > ~/Flumox.txt grep -R "Flumox" ~ > ~/Documents/Flumox.txt grep -R "Flumox" ~ > /Flumox.txt Question 16 I'm in the following directory: ~/Docs/2015/dsc/linux/spring/night If issue this command: cd ../../../.. In what directory would I be? ~/Docs/2015/ ~/Docs/2015/dsc/linux/ ~/Docs/2015/dsc/ ~/Docs/2012/ Question 17 I'm in my home directory and want to create the following directory hierarchy with one command: ~/calculus/homework/june/2012 Which command would do this? mkdir -r calculus/homework/june/2012 mkdir -p /calculus/homework/june/2012 mdir -p calculus/homework/june/2012 mkdir -p calculus/homework/june/2012 Question 18 I'm in the directory: /var/log/mail/map/june/2012/calculus/hard/problems/yikes/do/not/want/to/fail/this/class/again I 'cd' back to my home directory using 'cd ~'.
  • 6. Now I want to flip BACK to the preceding directory (/var/log/mail, etc.). What's the fastest way to do that? cd / var/log/mail/map/june/2012/calculus/hard/problems/yikes/do/not/want/to/fail/this/class/agai n cd ~ cd - cd ../../../../../../../../../../../../../../../ Question 19 I want to install the program "ruprecht" under Mint. Easiest way to do that is: Can't be done in Linux. sudo atitude install ruprecht sudo aptitude install ruprecht aptitude install ruprecht Question 20 I want a long listing of all files, including hidden files, in all directories residing under ~/POWER, and I want to save it to a file called 'myfiles'. What command would do this? ls -alR ~/POWER > myfiles sudo ls ~/POWER < myfiles ls -alR ~ > myfiles ls > files > ~/POWER Question 21 I want to update my system with the most recent packages. I do that with: su, su, sudio safe-upgrade aptitude update && atitude safe-upgrade atitutde update atitude safe-upgarde sudo aptitude update && sudo aptitude safe-upgrade Question 22
  • 7. I can't remember the command to delete a directory. A good way to find commands that have either the word 'delete' in it, or in the description, would be to run: delete --help find / -name delete apropos delete man delete Question 23 I want to know what devices are mounted on my system. The best way to find out is to run: umount dmesg | grep -exec sort {} ; sufo fdisk -l mount Question 24 I want to find all regular files in my /var/log/mail directory with a '*.doc' extension that are empty. What command would do this? find /var/log/mail -name '*.txt' sudo find /var/log/mail -type f -name '*.doc' -empty find / -type f -name '*.txt' -empty sudo find /var/log/mail -type f -name '*.txt' -empty Question 25 I can't remember how to create a series of nested directories using one command, but I remember that 'mkdir' is the command. The BEST way to find is the answer is to use (SELECT THE BEST ANSWER). :) 'Facebook" Prof Craiger. Email Prof Craiger at his DSC email address. Use Twitter to ask Prof Craiger. man mkdir