You are the systems administrator for a scientific research company that employs
ID: 3662249 • 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
Since you have access the users home directory so after entering the directory you can use ls command to list files in that directory.
E:g After entering the users home directory us
ls to list all files and folders in currect directory
ls -l to get long listing of the files
ls -a to include hidden files
To navigate to other folders use cd command e:g
cd Projects will change directory to Projects directory and using ls command now will list all files and folders in Projects directory.
use cd .. to move one directory back
To list all files extensions in a directory use ls with grep command like
ls -Xp | grep -Eo ".[^/]+$" | sort | uniq
There are many ways to view text files in linux and the simplest way is "cat" command
cat stands for "catenate." It reads data from files, and outputs their contents. It is the simplest way to display the contents of a file at the command line. E:g to display the contents of file named mytext.txt, type
cat mytext.txt
There are many text editors also available in linux like vi, gedit etc. If you have anyone installed then you can use these editors to view, create, edit files. To use vi editor type
vi mytext.txt and to use gedit type gedit mytext.txt
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.