Question

In UNIX if a file named "dimensions" contains fields separated by colons : What commands would...

In UNIX if a file named "dimensions" contains fields separated by colons : What commands would you use to display the third field followed by the fifth?

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

To extract particular columns of a file, the command to use in UNIX is: cut.

To extract the third and fifth column of a file named dimensions, delimited by : is

cut -f 3,5 -d : dimensions

-f is used to specify the columns to extract.

-d is used to specify the delimiter.

and the last parameter is the filename to extract from.

Add a comment
Know the answer?
Add Answer to:
In UNIX if a file named "dimensions" contains fields separated by colons : What commands would...
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
  • Unix questions, i need help on Hint: Commands to study to answer this question: predefined shell...

    Unix questions, i need help on Hint: Commands to study to answer this question: predefined shell variables, and .profile script file, echo SHELL, HOME, PATH, MAIL and TERM are predefined shell variables. You can use the value of a shell variable in a shell command putting $ in front of it. For example, to display the value of the HOME directory of the user, specify $HOME in the echo command like echo $HOME. Do not give just the value of...

  • What unix / linux command would I use to execute this: Display only the fifth field...

    What unix / linux command would I use to execute this: Display only the fifth field on each line in the file myclass using a delimiter of :

  • Objective: Practice common UNIX commands. Procedure: The following list of Unix commands are given for self-learning....

    Objective: Practice common UNIX commands. Procedure: The following list of Unix commands are given for self-learning. Use 'whatis' or 'man' command to find out about each command. Your document should include the description or screen shots of the output from each of the command. Commands: df du gzip file history wget Changing access rights: chmod u+x Dir1.0            adds execute permission for the owner chmod go-w file1              removes write permission for the group and others chmod ugo=rw testfile     sets...

  • Explain what the following UNIX command does: Is 'echo I.txt' Please type shell commands (for Windows....

    Explain what the following UNIX command does: Is 'echo I.txt' Please type shell commands (for Windows. UNIX, or any other system that you like) for: creating a directory called hello world list the contents of this directory create a file called iwashere.txt display the contents of the file iwashere.txt from the command-line Please write a simple program in C for accepting a string from the command-line, reversing and printing the reversed string to standard output.

  • In the data file employees.dat we have employee records with the following fields of information ...

    Unix/Linux In the data file employees.dat we have employee records with the following fields of information (ID, FN, LN, D, #) where ID: Employee identification number FN: Employee first name LN: Employee last name 8: Office number Write a shell script for processing employees.dat in such a way that we get the list of records (ID, FN, LN) and the total number of employees in the standard output as well as the file employees_by office.dat that contains emplayee records with...

  • In a linux command line Give AWK commands for accomplishing each of the following: Print the...

    In a linux command line Give AWK commands for accomplishing each of the following: Print the 2nd last field (the field directly before the last field) of each line from a file named 'last.txt' Assume you have a file called 'names' that contains a list of people, one person per line. Also, assume that on each line the 3rd field on that line contains the age of the person. Some of the people do not have an age listed, and...

  • COSC 3411 /ITAP 3411 Homework (UNIX Shell Commands) How would you ensure that all ordinary files...

    COSC 3411 /ITAP 3411 Homework (UNIX Shell Commands) How would you ensure that all ordinary files created by you have rw-rw---- as default permissions? How would you sort in the background a file called "bad.txt", and place the results in a file called "sort.txt"? Archive the contents of your home directory (including any subdirectories) using tar. Compress the tar archive with gzip. Now extract their contents. Use the “find” command to locate in /docs and /usr/docs all files that Begin...

  • e) In the context of Unix file system , what does "path" means? f) Write down...

    e) In the context of Unix file system , what does "path" means? f) Write down the absolute path for the main.cpp in the timeproj directory g)Write down the relative path from inside timeproj directory to the prgm1.cpp file h)Write down the Unix commands and key strokes needed to create a new sourcefile named time.cpp and then save it to disk using the pico editor. i) In Unix each file has three access modes, namely r,w, and x. 1) Write...

  • Create a class named Horse that contains data fields for the name, color, and birth year....

    Create a class named Horse that contains data fields for the name, color, and birth year. Include get and set methods for these fields. Next, create a subclass named RaceHorse, which contains an additional field that holds the number of races in which the horse has competed and additional methods to get and set the new field. Write an application that demonstrates using objects of each class. Save the files as Horse.java, RaceHorse.java, and DemoHorses.java. Program 1 Submission Template Fields:...

  • Problem 2 (36 pts): You are going to design a class named Computer. The class contains:...

    Problem 2 (36 pts): You are going to design a class named Computer. The class contains: A string field named manufacturer. A string field named serialNumber. A double field named speed (measured in Gigahertz). A constructor that has a parameter for each data field and sets the data fields with these values. A no-arg constructor that sets string fieldsto and numeric fields to 0. Mutator and Accessor methods for each data field. A method toString) that returns each field value...

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