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
At the command prompt, type cd /etc and press Enter. At the command prompt, type pwd...
At the command prompt, type cd /etc and press Enter. At the command prompt, type pwd and press Enter to view the current working directory. Did your current working directory change? Did you specify a relative or absolute pathname to the /etc directory when you used the cd /etc command?
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 commands in terminal What processes are running? In the previous task ("Command Based") you were...
Linux commands in terminal What processes are running? In the previous task ("Command Based") you were already familiar with the command "ps" which shows some or all of the processes that are running. When you run "ps", you start a new process and you can see the actual process in the output. Later in this task you will use "ps" more. The "top" command also shows an overview of the processes that exist on the system but it the overview...
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...
I did already posted this question before, I did get the answer but i am not...
I did already posted this question before, I did get the answer but i am not satisfied with the answer i did the code as a solution not the description as my solution, so i am reposting this question again. Please send me the code as my solution not the description In this project, build a simple Unix shell. The shell is the heart of the command-line interface, and thus is central to the Unix/C programming environment. Mastering use of...
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,...