Linux machine write out each step please. In your $HOME directory, create a new
ID: 3755394 • Letter: L
Question
Linux machine write out each step please.
In your $HOME directory, create a new directory called Junk. Create a set of directories to reect the structure shown above in the directory Junk. Write down the steps. 2. Type du in the Junk directory. Copy and paste the results 1 3. Copy all the les found in /usr/bin/X11 that start with the letter “f” into your bin directory locatedin in the Junk 4. Deciding your correspondence in Junk is private you change the permissions accordingly. What is the command you use? 5. Copy the le /etc/passwd into your letters directory in Junk and call the le 11dec98.tex. 6. Move to your draft subdirectory. Make a copy of 11dec98.tex and give it today’s date. 7. Corporate legal counsel anticipates a discovery motion coming their way. They request all users on this computer delete their electronic mail. What command(s) would you use? 8. What command(s) would you use to delete the entire Junk directory ? 9. Give the command construct that list only the visible les (no directories) in the /etc directory2 10. Give the command construct to provide only the number of processes that your are currently running (the result must be an integer). 11. Give the command construct that provides only the user names on your system that begins with the letter “s’ 12. What is Ebay’s IP address ? 13. What command should you use to login as root, returning a shell with a # prompt, while logged
Explanation / Answer
1) mkdir default behavior
You can type mkdir directly from your console to use it.
$ mkdir
By default, running mkdir without any parameter will create a directory under the current directory. Here’s a sample of it:
From the screenshot above, we created a directory called office. When we run mkdir command, we are in /home/pungki directory. So then the new directory, which is office, is created under /home/pungki directory. If we put an exact location - for example : /usr/local - , then Linux will create a directory under /usr/local directory.
When Linux found that the directory which suppose to be created already exists, then the tool will telling us that it can’t create it.
Another pre-requisite for creating a directory that you must have access to the location where the directory wants to be created. When you don’t have it then mkdir will report an error.
2) Create multiple directories
We can also create multiple directories at the same time. Let say we want to create directories named ubuntu, redhatand slackware. Then the syntax will be like this :
$ mkdir ubuntu redhat slackware
3) Add directory include its sub-directory
When you want to create sub-directories , you will need to use -p parameter. This parameter will create parent directory first, if mkdir cannot find it. Let say we want to create directory named "letter" and directory named "important" under directory letter. Then the syntax will be like this:
$ mkdir -p letter/important
4) Set access privilege
Using -m parameter, we can also set the access privilege for the new directory on-the-fly. Here’s an example.
$ mkdir -m=r-- letter
The above command will create a directory named letter and give access privilege read-only for the directory owner, directory group owner and anybody.
5) Print message for each created directory
If we want, we can use -v parameter to do this. Here’s an example.
$ mkdir -v ubuntu redhat slackware
Conclusion
Mkdir command is also one of the basic command that must known for everyone who want to learn Linux. As usual, you can always type man mkdir or mkdir --help to display mkdir manual page and explore it more detail.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.