Question: Given any directory, use the ls command to display: all files and sub - directories starting with the letter D ( note do not list
Given any directory, use the ls command to display:
all files and subdirectories starting with the letter Dnote do not list anything
in any sub directory
its immediate subdirectories subdirectories only, and no other ordinary files
its immediate hidden subdirectories only take a screenshot # that clearly shows
the
command and the result.
Assume that the following files are in the working directory:
$ ls
intro notesb ref section section sectionb
notesa ref ref section sectiona sentrev
Give commands for each of the following, using wildcards to express filenames with as few
characters as possible.
List all files that begin with section
List sectionsection and section files only.
List the intro file only.
List sectionsectionref and ref files only. Include the command in
thesubmission document #
File copy, move, and removal. Use one command to finish each step. You should not use
cd command at all.
Under your home directory, create a new text file using your campus email id as the file
name.
Create a copy of the file in the same directory using any name you like.
Create a subdirectory backup
Move the original file to backup and rename it using your first name.
Create a copy of the backup directory and all file in it; name it backup
Delete backup
Rename backup to backup
List the files in the new directory. Take a screenshot # that clearly shows the
command you
use and the result.
Link
a Go to your Documents directory;
b Create a file file with the text hello in it;
c Create a hard link named file linked to file;
d Create a soft link named soft linked to file; create another soft link
named soft linked to file
e View information of the files what command should you use to produce some
output
same to the figure below whats the difference of these files?
f Are contents of the files the same? What command do you use to verify that?
g Create a hard link file linked to soft
h Use a text editor Nano or VIM to edit soft: change hello to hello
world Now, what is the content in each of the files? Are they the same?
What if you change the text in any of these files?
i Rename file to change Now, how many files can you still open and view
the content?
Use the same command you used in step e to view file information. Whats the
change?
j Use a text editor to edit file: type Linux and save. Now what will
happen? Which files share the same content? Why?
k List all files you have now use the l option Take a screenshot # of the
command and the result.
Review questions discuss the ones you are not sure or totally confused in our discussion
board:
a How can you create a file named i Which techniques do not work, and why do they not
work? How can you remove the file named i
b Explain the following error message. Which filenames would a subsequent ls display?
$ ls
abc abd abe abf abg abh
$ rm abc ab
rm: cannot remove 'abc': No such file or directory
c Explain the error messages displayed in the following sequence of commands:
$ ls l
total
drwxrwxrx max pubs : dirt
$ ls dirt
$ rmdir dirt
rmdir: dirtmp: Directory not empty
$ rm dirt
rm: No match.
d Directory permission
i Make sure you are NOT the root user for this exercise. Why?
ii Create a new directory. What is the default permission for this directory?
iii. Create a new file in the new directory. What is the default permission for this file?
iv Set the directory permission to What does it mean?
v Set the directory permission to What does it mean?
vi Set the directory permission to What does it mean?
e How to set permissions for the following scenarios?
i You can modify a file but cannot delete it
ii You can see the files names directory content but you cannot read their
contents or modify them
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
