3.1.2.7 Lab - Getting Familiar With The Linux Shell
3.1.2.7 Lab - Getting Familiar With The Linux Shell
Introduction
In this lab, you will use the Linux command line to manage files and folders, and perform some basic
administrative tasks.
Recommended Equipment
CyberOps Workstation Virtual Machine
Cisco and/or its affiliates. All rights reserved. Cisco Confidential Page 1 of 8 www.netacad.com
Lab – Getting Familiar with the Linux Shell
Cisco and/or its affiliates. All rights reserved. Cisco Confidential Page 2 of 8 www.netacad.com
Lab – Getting Familiar with the Linux Shell
The -a option tells ls to show all files. Notice the . and .. listings shown by ls. These listings are used by
the operating system to track the current directory (.) and the parent directory (..) You can see the use of
the . and .. when using the cd command to change directories. Using the cd command to change the
directory to the . directory incurs no visible directory change as the . points to the current directory itself.
Cisco and/or its affiliates. All rights reserved. Cisco Confidential Page 3 of 8 www.netacad.com
Lab – Getting Familiar with the Linux Shell
Cisco and/or its affiliates. All rights reserved. Cisco Confidential Page 4 of 8 www.netacad.com
Lab – Getting Familiar with the Linux Shell
d. Notice that even though the some_text_file.txt file did not exist, it was automatically created to receive
the output generated by echo. Use the ls -l command to verify if the file was really created:
[analyst@secOps ~]$ ls –l some_text_file.txt
-rw-r--r-- 1 analyst analyst 50 Feb 24 16:11 some_text_file.txt
e. Use the cat command to display the contents of the some_text_file.txt text file:
[analyst@secOps ~]$ cat some_text_file.txt
This is a message echoed to the terminal by echo.
f. Use the > operator again to redirect a different echo output of echo to the some_text_file.txt text file:
analyst@secOps ~]$ echo This is a DIFFERENT message, once again echoed to the
terminal by echo. > some_text_file.txt
g. Once again, use the cat command to display the contents of the some_text_file.txt text file:
[analyst@secOps ~]$ cat some_text_file.txt
This is a DIFFERENT message, once again echoed to the terminal by echo.
What happened to the text file? Explain.
__ File teks sepenuhnya diganti dengan pesan baru. > operator menghancurkan konten file txt sebelum
menulis pesan yang dicetak oleh echo. ___________________________________________________
____________________________________________________________________________________
Cisco and/or its affiliates. All rights reserved. Cisco Confidential Page 5 of 8 www.netacad.com
Lab – Getting Familiar with the Linux Shell
c. Use the ls -la command to display all files in the home directory of analyst, including the hidden files.
[analyst@secOps ~]$ ls –la
How many files are displayed now, more than before? Explain.
___ Banyak yang ditampilkan ls -la, selain file biasa, semua file tersembunyi di folder. _______________
Is it possible to hide entire directories by adding a dot before its name as well? Are there any directories
in the output of ls -la above?
___ Ya, ada banyak direktori tersembunyi di keluarannya. _____________________________________
Give three examples of hidden files shown in the output of ls -la above.
____ .config, .bash_history, .xinitrc _______________________________________________________
d. Type the man ls command at the prompt to learn more about the ls command.
[analyst@secOps ~]$ man ls
e. Use the down arrow key (one line at a time) or the space bar (one page at a time) to scroll down the page
and locate the -a used above and read its description to familiarize yourself with the ls -a command.
Cisco and/or its affiliates. All rights reserved. Cisco Confidential Page 6 of 8 www.netacad.com
Lab – Getting Familiar with the Linux Shell
Cisco and/or its affiliates. All rights reserved. Cisco Confidential Page 7 of 8 www.netacad.com
Lab – Getting Familiar with the Linux Shell
Reflection
What are the advantages of using the Linux command line?
___ Command line memungkinkan user lebih banyak opsi dan kontrol atas grafis interface. Saat user menjadi
lebih berpengalaman dengan command line, user dapat menggabungkan command ini dalam skrip untuk
melakukan tugas rutin. Interface command line menggunakan lebih sedikit sumber daya saat user mengatur
komputer dari jarak jauh. ___________________________________________________________________
Cisco and/or its affiliates. All rights reserved. Cisco Confidential Page 8 of 8 www.netacad.com