download and extract the following file. You can issue this command in the termi
ID: 669309 • Letter: D
Question
download and extract the following file. You can issue this command in the terminal:
wget -qO- https://www.dropbox.com/s/8neqwwwdw000t4g/wrong_ext_file.tgz | tar zxf -
You will see there are two files: wrong_ext_file_1.jpg and wrong_ext_file_2.cpp. Identify what their real file types are.
Manipulating files and directories.
enter the command used for part a-q
a. Change directory to your home directory
b. Create a directory, called assg_4.2
c. Change directory to assg_4.2
d. Create two directories, called dir_1 and dir_2
e. Create the following nested directories dir_3/subdir_3.1/subdir_3.1.a
f. Copy the group file from /etc directory to the current directory
g. Copy the group file in the current directory, called group_copy, into the dir_1 directory
h. Rename group_copy file in the dir_1 directory to group_1
i. Copy dir_3 directory into dir_1 directory
j. Rename the dir_2 directory to DIR_1. Observe that filenames in Linux are case sensitive.
k. Create a hard link of group file, called group_hard, in the current directory
l. Create a symbolic link of group file, called group_sym, in the current directory
m. List the content of the current working directory in long format with the inode number. Observe the inode number of the group, group_hard, and group_sym files
n. Remove group file
o. List the content of the current working directory in long format. Observe the broken symbolic link at the group_sym files
p. Change directory to your home directory using relative pathname
q. Remove assg_4.2 directory and all of its contents
Redirection.
By using echo command and redirection, what commands are to create a vi_poem.txt file with the content below.
a. You press the keys with no effect,
b. Your mode is not correct.
Download and extract the following file. You can issue this command in the terminal:
wget -qO- https://www.dropbox.com/s/cd6zanwsfik6dgn/alice.tgz | tar zxf -
You will see there are two files: alice.txt and small.txt. By using pipelines, what commands’ pipelines do you use to find out the following information in the alice.txt file. You can test it using small.txt file. All the text files have been preprocessed: all the words are in lowercase and one word per line. Your pipelines should only display information we need. Note: I only need the commands, not the answer for the questions below.
How many words are there?
How many unique words are there?
What are the 5 most frequent words in the descending order (most frequent first)?
How many times the word “change” appeared regardless of its tense or its plurality?
Explanation / Answer
a) Change directory to your home directory
cd /
b) Create a directory, called assg_4.2
mkdir assg_4.2
c) Change directory to assg_4.2
cd ass_4.2
d) Create two directories, called dir_1 and dir_2
mkdir dir_1
mkdir dir_2
e) Create the following nested directories dir_3/subdir_3.1/subdir_3.1.a
mkdir dir_3
cd dir_3
mkdir subdir_3.1
cd dir_3.1
mkdir subdir_3.1.a
f) Copy the group file from /etc directory to the current directory
cp -i /etc/group [path of current directory]
q) Remove assg_4.2 directory and all of its contents
sudo rm -rf folderName
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.