You are the systems administrator for a scientific research company that employs
ID: 3887269 • Letter: Y
Question
You are the systems administrator for a scientific research company that employs over
100 scientists who write and run Linux programs to analyze their work. All of these
programs are stored in each scientist’s home directory on the Linux system. One scientist
has left the company, and you are instructed to retrieve any work from that scientist’s
home directory. When you enter the home directory for that user, you notice that there
are very few files and only two directories (one named Projects and one named Lab). List
the commands that you would use to navigate through this user’s home directory and
view filenames and file types. If there are any text files, what commands could you use to
view their contents?
Explanation / Answer
When you enter the home directory for that user, you notice that there
are very few files and only two directories (one named Projects and one named Lab).
List the commands that you would use to navigate through this user’s home directory and
view filenames and file types.
Assume the user (the scientist who left) is named XYZ. Now to navigate through this users
home directory, the command is:
> cd /home/XYZ/
And now to list all the contents of that directory, the command required is:
>ls
This will give the short listing of the files in that home directory.
Whereas if you want to give the detailed listing along with their file types, and dates of
creation etc, the command is:
>ls -l
If there are any text files, what commands could you use to
view their contents?
Now, lets assume there is a text file titled myDiary.txt, to view the contents of the file,
the command is:
>cat myDiary.txt
This will display the contents of the file right at the terminal itself. If the file is
huge and if you want to display the contents one page at a time, you can concatenate the
instruction with less command like this:
> cat myDiary.txt | less
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.