Question

Question 1) Copy file called sortfile from my home directory. The file contains three columns of...

Question 1) Copy file called sortfile from my home directory. The file contains three columns of information : username, uid number and group name respectively, separated by a field separator.

Will the following command sort the file on the group name field?

sort -t! -k3 sortfile

A) Yes

B) No

Question 2) Copy the file called sortfile from my home directory. The file contains three columns of information : username, uid number and group name respectively, separated by a field separator.

The following command will reverse sort the the file numerically on the uid.

sort -t! -k2rn sortfile

A) True

B) False

Question 3) Create a sort command string that willnumerically sort the file called /etc/group on the GID field (3rd field).

Complete the command string below to meet the above statement.

sort -t: -### /etc/group

Replace the ### with the correct characters to complete the commmand string.

Provide ONLY the characters that replace the ### in your answer.

Answer ___________

Question 4) cd to my home directory.

Execute the command: ls -l | sort -k5n

This command will sort the ouput of the ls command by the file size and list the largest file last.

A) True

B) False

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution

Question 1) Copy file called sortfile from my home directory. The file contains three columns of information : username, uid

Explanation

Question 1

Option k is used to specify the key to be used to sort the file. In this case, it is 3 which indicates the column

so answer is true

Question 2

the correct command is

sort -t! -k2nr sortfile

so answer is false

Question 3

k3 specifies the third column

To sort a file numerically used –n option

so answer is -k3n

Question 4

True

maverick@maverick-Inspiron-5548:-$ ls -1 total 44892 -rw-rw-r-- 1 maverick maverick 1176 Feb 16 00:19 1.0 -rwxrwxr-x maverick

from, the picture we know 5th column is file size

---

all the best

Add a comment
Know the answer?
Add Answer to:
Question 1) Copy file called sortfile from my home directory. The file contains three columns of...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • QUESTION 1 From YOUR home directory, execute a find command string that will locate the file...

    QUESTION 1 From YOUR home directory, execute a find command string that will locate the file called resolv.conf. Include the -exec flag in the find command to cat the file to the screen. Begin your find search from the letc directory. Select the correct find command string below that will accomplish this. find /etc -name 'resolv.conf-cat f} \; find /etc -name 'resolv.conf' -exec cat {} \; find . -name 'resolv.conf' -exec cat {} \; O find / -name 'resolv.conf' -exec...

  • QUESTION 1 From YOUR home directory, execute a find command string that will locate the file...

    QUESTION 1 From YOUR home directory, execute a find command string that will locate the file called resolv.conf. Include the -exec flag in the find command to cat the file to the screen. Begin your find search from the letc directory Select the correct find command string below that will accomplish this. find /etc-name 'resolv.conf -cat D find /etc-name 'resolv.conf -exec cat 0 find. -name 'resolv.conf -exec cat 0\ find /-name 'resolv.conf' -exec cat 0 QUESTION 2 What find command...

  • Really need help from 11 on: Create the directory structure IFT383FinalExam/Activities/Activity1 in your home directory. Using...

    Really need help from 11 on: Create the directory structure IFT383FinalExam/Activities/Activity1 in your home directory. Using the cat command, create a file named classRoster with the following fields, separated by a comma. Student ID First Name Last Name Grade Program of Study ASURITE ID (username) Add three records to your file. Display the contents of the file. Move the file classRoster to the directory Activity1. Go to the Activity1 directory. Display the directory you are in. Add read, write and...

  • UNIX File Permission help, please answer the questions in the green boxes. Thank you Lab 03...

    UNIX File Permission help, please answer the questions in the green boxes. Thank you Lab 03 File Permissions In this lab we will: learn about file permissions learn to create symbolic links and hard links Utilities that will be utilized in this Lab: us, cd, less, cat touch, chmod id umask, mkdir, In, echo and redirection Users and Groups Linux supports several methods of controlling access to files an directories. In this lab we are going to learn the traditional...

  • 1. Navigate to your home directory by typing cd. Now type ls and notice that there...

    1. Navigate to your home directory by typing cd. Now type ls and notice that there is a subdirectory called Downloads. Now navigate to the root of the file system by typing cd /. From here, which single command would you use to navigate directly to the Downloads folder that is located in your home directory? The output of the command would be as follows: 2. From the Downloads directory which single command would you use to navigate back up...

  • 1) Copy bother10.sh from /home/ghoffman/course_files/it244_files to your hw6 directory. Run this program in the background redirecting...

    1) Copy bother10.sh from /home/ghoffman/course_files/it244_files to your hw6 directory. Run this program in the background redirecting output to /dev/null. Be sure you copy and run bother10.sh, NOT bother.sh. 2) Run a command that shows the job number of the process running bother10.sh. 3) Run a command that shows the process ID of the process running bother10.sh. 4) Copy the script make_foo.sh from ~ghoffman/course_files/it244_files to your current directory. Run this script. Using touch, create the file foo.txt. Perform a long listing...

  • 1. Set up an easy way to copy files from /home/distribution/cnguyen/cis18b directory on voyager, without having...

    1. Set up an easy way to copy files from /home/distribution/cnguyen/cis18b directory on voyager, without having to type the long path name every time. Make your set up “permanent” for this quarter (the set up should last from one login session to another). 2. Use echo to write a brief explanation of your set up in step 1. 3. If you are not at your home directory, go to your home directory and don’t change directory for the rest of...

  • Select your answer from here. absolute pathname to the file called xyz changes the directory to...

    Select your answer from here. absolute pathname to the file called xyz changes the directory to the parent of the current directory. lists current directory files including the invisible files sends xyz file to the line printer deletes the directory called xyz displays the content of the file called xyz displays the current directory pathname cancels the printing job on the 1p 1 printer confirms the deletion of the xyz file before deleting it lists the current directory in long...

  • VI Exercise Ex 1. At your home directory, create a new file “test1” which contains following...

    VI Exercise Ex 1. At your home directory, create a new file “test1” which contains following 2 lines, save and exit. Hello, This is my vi test file SOI Asia project stands for School of Internet Asia project Ex 2. Edit file “test1” to contain following content. Change content on first line by using command “x” to delete unwanted characters and then inserting desired texts. Then use “G” to go to last line and press “o” to insert text at...

  • Step 3: How would you write this script in C? It needs to do the things...

    Step 3: How would you write this script in C? It needs to do the things required in step 3. 1. You have received a new batch of distinguished users; their basic information is located in newusers.tar. Inside of the tar file, there is a file called "newusers.txt" which contains a colon-separated entry for each user: the username, the uid, the GECOS information, and the user's preferred shell. Also in the tar file you will find a public key for...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT