Questions & AnswersNetworking

1. Login to your server as regular user using ssh. 2. Launch tmux...

Question
Answered step-by-step
Asked by JudgeGoat3049 on coursehero.com

1. Login to your server as regular user using ssh. 2. Launch tmux...

1. Login to your server as regular user using ssh.
2. Launch tmux and split the terminal into two vertical panes.
3. 15pts. Using for loop in CLI :
3.1. In the left pane, process the contents of /etc directory to print filemode, filesize, and
filename of text files using a for loop, command substitution, and pipes.
a) Use ls -1 /etc when creating the list in the for statement.
b) In the body of the loop, use test command to see if the entry is a file or a directory.
Proceed only if it's a file, ignore if it's a directory. Note that you will need to prepend
/etc to filename because ls -1 returns only the filename as in ls -l /etc/$_FNAME.
c) Use tr command to squeeze multiple blanks into one blank in each line, like tr -s' ' .
d) Use cut command to select individual fields in an input line.
e) Use tr command again to translate field separator, aka delimiter, blank to a tab as in
tr ' ' '\t' .
f) 0pts. Use head command to limit the size of listing.
4. 15pts. Using while loop in CLI to read from a file :
4.1. In the right pane, read the contents of ls.etc file to print filemode, filesize and filename of
text files using a while loop.
a) Save the output from ls -l /etc command in a file ls.etc .
b) Use a while loop to read ls.etc line by line into a variable _LINE.
c) Use echo command to pipe the output to cut command to select the fields to print.
d) Replace delimiter blank with tab character.
e) Use grep to filter in only the lines that don't have a d in the first position as in
grep -v ^d .
f) 0pts. Use head command to limit the size of listing.
5. 10pts. Task scheduling using at :
5.1. shell script 300*.at which
a) tests if a file /tmp/norun does exist. If yes, it will echo removing /tmp/norun with a
timestamp of the form YYYYMMDD-HH:MM:SS to 300*.log (hint: use %Y%m%d-%T format
of the date command) and remove /tmp/norun .
b) reschedules itself to run 5 minutes later using at command.
5.2. Create a cron entry to run a script 300*.crn every 1 minute every day of every month. . The
script will
a) test if /tmp/norun exists. If yes, it will echo not running with a timestamp as in
5.1.a to 300*.log , and exit with return code 2.
b) otherwise, create /tmp/norun and echo Hello world with a timestamp as in 5.1.a to
300*.log .
5.3. Run 300*.at script manually. Schedule 300*.crn using crontab -e as a regular user.
5.4. Run atq command to see if your script has been scheduled.
5.5. Wait long enough you accumulate log messages in 300*.log . Display the first 20 lines in
300*.log .
5.6. Use your student id number to replace 300* .
5.7. A sample output is provided in W06.
6. Capture your commands in screenshot(s) and submit in dropbox.
7. Your screenshot(s) must comply with the submission guidelines to be accepted.
 

 

 

 

 

 

Answer & Explanation

Solved by verified expert
Answered by ProfessorTankMongoose23 on coursehero.com

sectetur adipiscing elit

sectetu

se

sectetur adipiscing elit. Nam lac

sectetur adipiscing elit. Nam laci

sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentes

secte

sectetur adipi

se

sectetur adipiscing el

sectetur adipiscing elit.

sectet

CliffsNotes Logo

Unlock access to this and over
10,000 step-by-step explanations

Unlock Explanation

Have an account? Log In

<p style="margin-left:0px;">sectetur adipiscing elit. Nam lacinia pulv</p><p style="margin-left:0px;">sectetur adipiscing elit. Nam lacini</p><p style="margin-left:0px;">se</p><p style="margin-left:0px;">sectetur adipiscing elit. Nam lacinia</p><p style="margin-left:0px;">sectetur adipiscing elit. Nam laci</p><p style="margin-left:0px;">sectetur adipiscing elit. N</p><p style="margin-left:0px;">sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facili</p><p style="margin-left:0px;">sectetur adip</p><p style="margin-left:0px;">se</p><p style="margin-left:0px;">sectetur adipiscing elit. Nam laci</p><p style="margin-left:0px;"> </p><p style="margin-left:0px;">sectetur adipiscing elit. Nam lacinia p</p><p style="margin-left:0px;">sectetur adipiscing elit. Nam laci</p><p style="margin-left:0px;">sectetur adipiscing elit. N</p><p style="margin-left:0px;">sectetur adipiscing elit. Nam lacinia pulvinar tortor ne</p><p style="margin-left:0px;">sectet</p><p style="margin-left:0px;">sect</p><p style="margin-left:0px;">sectetur adipiscing elit. Nam lacinia pulvinar tortor ne</p><p style="margin-left:0px;">sectetur adipisc</p><p style="margin-left:0px;">se</p><p style="margin-left:0px;"> </p><p style="margin-left:0px;">sectetur adipiscing elit. Nam lacinia pulvinar torto</p><p style="margin-left:0px;">sectetur adipiscing elit. Nam lacinia pulvinar</p><p style="margin-left:0px;">sectetur adipiscing elit. Nam lac</p><p style="margin-left:0px;"> </p><p style="margin-left:0px;">sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisi</p><p style="margin-left:0px;">sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facili</p><p style="margin-left:0px;">sectetur adipiscing elit. Nam lacinia pulvinar</p><p style="margin-left:0px;">sectetur adipiscing elit.</p><p style="margin-left:0px;"> </p><p style="margin-left:0px;">sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellente</p>

Step-by-step explanation

sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pelle

 

sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus e

 

sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapi

 

sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus ef

 

sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante,

 

sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a moles

 

sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facili

 

sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum v

Get unstuck with a CliffsNotes subscription

Example CliffsNotes Question and Answer
Unlock every step-by-step explanation, download literature note PDFs, plus more.Get Access

Related Q&A