can someone do this in unix please read every simgle step correctly In its simplest form, the ls utility (Sobell, page 5

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

can someone do this in unix please read every simgle step correctly In its simplest form, the ls utility (Sobell, page 5

Post by answerhappygod »

can someone do this in unix please read every simgle step correctly
In its simplest form, the ls utility (Sobell, page 52) lists the names of files in the working directory (Sobell, page 86).
Use ls to list the names of the files in the working directory.
When you call ls with an argument (a word following ls and separated from ls by a SPACE), ls displays the name of the file named by the argument or displays an error message if the file does not exist.
Use ls to list the name of a file that exists in the working directory.
Use ls to list the name of a file that does not exist in the working directory.
2.
The touch command is used to create an empty file with a name of the argument being the created file name.
Use touch to create an empty file named empty.txt. Use ls to show the file now exists.
3.
The following instructions show how to create a short text file.
You can correct any mistakes on the command line you are entering by using the correction keys explained in the previous lab. If you notice a mistake on a previous line, leave it as it is; you will learn how to correct these kinds of mistakes in a later lab.
a.
Give the following command to open the vim editor so it is editing the file named practice.txt
$ vim practice.txt
The screen will look like Figure 6-1 on page 162 of Sobell.
If bash displays a command not found error, give the preceding command again, replacing vim with vi.
b.
Before you can insert text into the file you are creating, you must put vim into Input mode. Type the letter i key (for Input mode) to put vim into Input mode.
c.
With vim in Input mode, type the following short lines, ending each line with an ENTER key.
Comet student at a kegger at UT Austin: All Comet students are above average.
How do you know when a Comet is addicted to texting? When they say L-O-L aloud in real life,
instead of actually laughing.
Did you hear about the comet named Micheal Alware? His e-mail address is [email protected]
Make sure to end the last line with an ENTER.
d.
Before you can give a command to exit from vim, you must put vim into Command mode. Press ESCAPE key to put vim into Command mode.
e.
With vim in Command mode (:), give the command :wq! to write the new file to disk and exit from vim.
f.
Use ls with an argument using the name of the file created by vim
4
Hidden filles in Linux start with a dot (.).
Use ls .* to display all the hidden files in the home directory. Use vim to open the file .bashrc.
In vim find the following lines:
# Some so-I-won't-bash-my-head-into-the-wall-because-I-deleted-a-file commands
alias alias alias
cp='cp -i' mv='mv -i' rm='rm -i'
# Some help commands alias help="man man"
Add the following 3377 comments and comment out the following lines using #
# Some so-I-won't-bash-my-head-into-the-wall-because-I-deleted-a-file commands # 3377 wants standard behaviors, thanx IT Group
#alias cp='cp -i' #alias mv='mv -i' #alias rm='rm -i'
# Some help commands
# # 3377 wants standard behaviors, thanx IT Group # alias help="man man"
Save the .bashrc file
Use grep on .bashrc to display the new commented lines grep 'cp=\|mv=\|rm=\|help=' .bashrc
3.
The cat utility (Sobell, page 52) displays the contents of a file.
Use the cat utility to display the contents of the practice.txt file you just created with vim.
4.
The cp utility (Sobell, page 53) makes a copy of a file.
Use cp to make a copy of the practice.txt file you just created named practicecopy.txt. Display the file with ls.
5.
The rm utility (Sobell, page 52) removes (deletes) a file. Use rm to remove the practicecopy.txt file.
6.
What do ls and cat show when applied to the removed file practicecopy.txt?
7.
The less utility (Sobell, page 53), which was introduced in the previous lab, displays a file one screen at a time.
Use the less utility to display a long file, such as .bashrc, one screen at a time. Capture the less output until the end.
Then exit from less when at end.
8.
By default, the head utility (Sobell, page 56) displays the first 10 lines of a file.
Use head to display the first 10 lines of a file such as .bashrc. Capture the head output and then end.
9.
By default, the tail utility (Sobell, page 57) displays the last 10 lines of a file.
Use tail to display the last 10 lines of a file such as .bashrc.
10.
The hostname utility (Sobell, page 53) displays the name of the system on which you are working.
Use hostname to display the name of the system on which you are working.
11.
The mv utility (Sobell, page 53) renames a file.
Use mv to rename the copy of the file practice.txt to mypractice.txt.
12.
The grep utility (Sobell, page 56) searches for a string of characters in a file.
Use grep to display all lines that contain a string alias in the file .bashrc. 13.
Using the vim editor, create a file named days that holds the names of the days of the week, in calendar order.
Monday Tuesday Wednesday Thursday Friday Saturday Sunday
Use cat to display the days file.
14.
The sort utility (Sobell, page 58) displays a file in alphabetical order.
Use sort to display the days file days in alphabetical order. 15.
The file utility (Sobell, page 60) identifies the contents of a file. Use file to determine the type of the days file
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply