Question

Linux commands, the answer only about writing commands 1. What is the cd command that will...

Linux commands, the answer only about writing commands

1. What is the cd command that will change the current directory (which is “bob”) to the alice directory using a relative pathname (use the simplest possible relative pathname). Be sure to return to the “bob” directory

2. What is the cd command that will change the current directory (which is “bob”) to the etc directory using a relative pathname (use the simplest possible relative pathname). Be sure to return to the “bob” directory.

3. What is the cd command that will change the current directory (which is “bob”) to the lab02 directory underneath the home directory of user bob using a relative pathname (use the simplest possible relative pathname). Be sure to return to the “bob” directory.

4. What is the cd command that will change the current directory (which is “bob”) to the lab02 directory underneath the home directory of user jlucas using a relative pathname (use the simplest possible relative pathname). Be sure to return to the “bob” directory

Homework Answers

Answer #1

Before we dive into the answer let us see briefly cd command and relative path.

cd stands for change directory. This command is used to change the current working directory. Syntax is as follows

cd <path>

<path> can be relative path or absolute path

Relative path means specifying a path with respect to the current location. For example "go to the parent directory of current directory, go to a directory which is inside the current same directory" etc. As an example

cd ..

The above command uses a relative path to go to parent directory of the current directory

SOLUTION TO QUESTIONS

1. What is the cd command that will change the current directory (which is “bob”) to the alice directory using a relative pathname (use the simplest possible relative pathname). Be sure to return to the “bob” directory

// change from bob to alice directory
cd ../alice
cd ../bob

We use .. which means parent directory of current directory followed by the directory which we wish to go. We return to bob directory in the second line command

2. What is the cd command that will change the current directory (which is “bob”) to the etc directory using a relative pathname (use the simplest possible relative pathname). Be sure to return to the “bob” directory.

// change from bob to etc directory
cd ../etc
cd ../bob

3. What is the cd command that will change the current directory (which is “bob”) to the lab02 directory underneath the home directory of user bob using a relative pathname (use the simplest possible relative pathname). Be sure to return to the “bob” directory.

// change from bob to etc directory
cd ~/lab02
cd -

The ~ symbol is used to navigate to the home directory

The - symbol is use to take us back to our old "current working directory"

4. What is the cd command that will change the current directory (which is “bob”) to the lab02 directory underneath the home directory of user jlucas using a relative pathname (use the simplest possible relative pathname). Be sure to return to the “bob” directory

cd ~/jlucas/Downloads
cd ~/bob
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
PART 4: Learn about commands to navigate the directory tree structure: use the ls –ali /  ...
PART 4: Learn about commands to navigate the directory tree structure: use the ls –ali /   command to review the contents of the / directory Review the Linux Filesystem Standard (FSSTD) and document the following directories’ contents / ------- |--bin |--boot               |--dev               |--etc |--home               |--lib               |--mnt               |--opt               |--root               |--sbin               |--tmp               |--usr               |--var 3. use the cd etc  OR cd /etc  to change your default directory to the etc directory 4. use the...
PLEASE DO QUICK LINUX ASSIGNMENT PLEASE ILL THUMBS UP You need to paste the command and...
PLEASE DO QUICK LINUX ASSIGNMENT PLEASE ILL THUMBS UP You need to paste the command and the output in a word document and submit it. Part1: 1. Log in to Linux using your user account name and password. 2. If you logged in using a graphical login screen, open a terminal window by clicking on the icon in the lower left corner of the desktop to open the main menu, then selecting System Tools, then Terminal. A terminal window opens....
Linux Operation SECTION 2 – File and Directory Permissions: FILE PERMISSIONS: What is the command used...
Linux Operation SECTION 2 – File and Directory Permissions: FILE PERMISSIONS: What is the command used to find out which user account you are logged into?      . This command may come in handy in the following exercises. Ensure you are in your home directory of the student1 account. Use the echo command with output redirection to create a file called labfile4 and put the following text in this file: “This is the first line of labfile4”. Using the symbolic notation...
Lab of operating system: please use the linux server please so all the commands used and...
Lab of operating system: please use the linux server please so all the commands used and the output PROBLEM 1: Create a file and name it f1 • Cerate a directory and name it d1 • Move f1 to d1 • Create a directory and name it d2 • Move d1 to d2 • Check if d1 is inside d2 • Check if f1 is inside d1 • While your (Current Working Directory) CWD is d1, move back f1 to...
1. By convention, how are configuration files separated from regular files? (NOTE: A practical effect of...
1. By convention, how are configuration files separated from regular files? (NOTE: A practical effect of the separation is that they are not displayed by the default version of the ls command)                         a. the prefix "rc" (rc.filename)               c. the extension .cfig                         b. a dot (.) at the beginning                    d. by having the SUID bit set 2. The IP address which is reserved for local loopback (equivalent to "localhost") is:                         a. 255.255.255.0                                   c. 192.168.70.1...
linux Using dpkg or apt, what would be the full command you would use to find...
linux Using dpkg or apt, what would be the full command you would use to find out if the python package was installed? This is tricky because Python’s actual package name is python3. $ If it is installed, what version is installed according to the dpkg or apt output? If it wasn’t installed, can you install it? What command would you use to do this? $ 2. Using dpkg, what would be the full command you would use to determine...
DTMF Home Automation System This project is about controlling of home appliances using DTMF (Dual Tone...
DTMF Home Automation System This project is about controlling of home appliances using DTMF (Dual Tone Multi Frequency) technology. These appliances includes lights, fans, central heating, etc. A control unit will be required to encode the 4bit binary code from the DTMF decoder to link with 16 appliances or operations. However anyone can control your appliances if they know the cell number of the phone connected to the module. Furthermore, the number of appliances is limited to 16, which is...
please use linux/unix command terminal to complete, step 1 1-create a new directory named by inlab4...
please use linux/unix command terminal to complete, step 1 1-create a new directory named by inlab4 enter directory inlab4 create a new file named by reverse.c with the following contents and then close the file: /*reverse.c */ #include <stdio.h> reverse(char *before, char *after); main() { char str[100]; /*Buffer to hold reversed string */ reverse("cat", str); /*Reverse the string "cat" */ printf("reverse(\"cat\")=%s\n", str); /*Display result */ reverse("noon", str); /*Reverse the string "noon" */ printf("reverse(\"noon\")=%s\n", str); /*Display result */ } reverse(char *before,...
1. Vim commands: a. How do you auto indent your program? b. Explain what the following...
1. Vim commands: a. How do you auto indent your program? b. Explain what the following commands do: dd, y3, p, :set cindent (1 pt) VIM exercises These exercises on the computer need to be repeated by each student in the pair. This is to ensure that both students understand how to get around in Linux!!! For this part of the lab, you will create a .vimrc file that will help you develop your C++ programs using VIM. First, we...
DTMF Home Automation System This project is about controlling of home appliances using DTMF (Dual Tone...
DTMF Home Automation System This project is about controlling of home appliances using DTMF (Dual Tone Multi Frequency) technology. These appliances includes lights, fans, central heating, etc. A control unit will be required to encode the 4bit binary code from the DTMF decoder to link with 16 appliances or operations. However anyone can control your appliances if they know the cell number of the phone connected to the module. Furthermore, the number of appliances is limited to 16, which is...