Is there a unix command to reverse the lines in a file?

1 Answer

Answer :

answer:tac tac (cat spelled backwards) works like cat, but reverse the order of the lines (last line is written out first).

Related questions

Description : Unix command to show distro info?

Last Answer : answer:uname -a might do the trick. This is the output on my Mac. Macintosh:~ ****************$ uname -a Darwin Macintosh.local 9.2.0 Darwin Kernel Version 9.2.0: Tue Feb 5 16:13:22 PST 2008; root:xnu-1228.3.13~1/RELEASE_I386 i386

Description : Why doesn't Cron allow for intervals UNDER 60 seconds?

Last Answer : perhaps because anything that needs to happen more than once a minute really ought to be its own process, governing its own schedule?

Description : How do deal with Mac's Display Names concept when coding at the OS level?

Last Answer : Sounds like there may be two name-like values for the same device. I don’t know the answer though so I’ll refrain from further conjecture.

Description : What is the function of following UNIX command? WC - lb& (A) It runs the word count program to count the number of lines in its input, a, writing the result to b, as a foreground process. (B) It runs ... (D) It copies the l ' numbers of lines of program from file, a, and stores in file b.

Last Answer : (B) It runs the word count program to count the number of lines in its input, a, writing the result to b, but does it in the background.

Description : Unix command to change the case of first three lines of file “shortlist” from lower to upper (1) $ tr ‘[a-z]’ ‘[A-Z]’ shortlist | head-3 (2) $ head-3 shortlist | tr ‘[a-z]’ ‘[A-Z]’ (3) $ tr head-3 shortlist ‘[A-Z]’ ‘[a-z]’ (4) $ tr shortlist head-3 ‘[a-z]’ ‘[A-Z]’

Last Answer : (2) $ head-3 shortlist | tr ‘[a-z]’ ‘[A-Z]’ 

Description : Which command is used to sort the lines of data in a file in reverse order A. sort B. sh C. st D. sort -r E. None of the above

Last Answer : D. sort -r

Description : Which of the following statement is not correct with reference to cron daemon in UNIX O.S? (A) The cron daemon is the standard tool for running commands on a predetermined schedule. (B) It starts ... command lines and the times at which they invoked. (D) Crontab for individual users are not stored.

Last Answer : (D) Crontab for individual users are not stored.

Description : What will be the output of the following Unix command ? $rm chap0\[1 - 3\] (A) Remove file chap0[1 - 3] (B) Remove file chap01, chap02, chap03 (C) Remove file chap\[1 - 3\] (D) None of the above

Last Answer : (A) Remove file chap0[1 - 3]

Description : In Unix, the command to enable execution permission for file “mylife” by all is ................ (A) Chmod ugo+X myfile (B) Chmod a+X myfile (C) Chmod +X myfile (D) All of the above

Last Answer : (D) All of the above

Description : Write Unix command for following: i)create a folder OSY ii) create a file FIRST in OSY folder iii) List/display all files and directories. iv) Write command to clear the screen

Last Answer : i) create a folder OSY: $mkdir OSY ii)create a file FIRST in OSY folder: $cd OSY $cat>FIRST or $ touch FIRST iii) List/display all files and directories: $ls iv) to clear screen: $clear

Description : State weather the following statement is true or false for Sendmail. 1).Sendmail is a command-line tool designed for most UNIX-like operating systems. 2).It define a method of transferring mail, and acts as a client/server ... . false C. 1. false, 2. false, 3. false D. 1. true, 2. true, 3. false

Last Answer : A. 1. True, 2. False, 3. true

Description : The UNIX compress command is one of the earlier applications of a. LZ77 b. LZ78 c. Huffman d. LZW

Last Answer : d. LZW

Description : The Unix command: $ vi file1 file2 (A) Edits file1 and stores the contents of file1 in file2 (B) Both files i.e. file1 and file2 can be edited using ex' command to travel between files (C) Both ... using the mv' command to move between the files (D) Edits file1 first, saves it and the edits file2

Last Answer : (B) Both files i.e. file1 and file2 can be edited using ‘ex’ command to travel between files

Description : What does the following command do? grep −vn abc x (A) It will print all of the lines in the file x that match the search string abc (B) It will print all of the lines in file x that do not ... (D) It will print the specific line numbers of the file x in which there is a match for string abc

Last Answer : (A) It will print all of the lines in the file x that match the search string “abc”

Description : In a *nix shell how can I touch a file naming it with the system's current UNIX timestamp?

Last Answer : answer:touch `date +%s` Backticks (on the same key as the tilde, next to 1/!) are really powerful. They work by evaling the contained command and then substituting the output. You can do just about anything on the shell in a single line using backticks, pipes, and xargs. Learn ‘em, love ‘em.

Description : A UNIX file system has 1 KB block size and 4-byte disk addresses. What is the maximum file size if the inode contains ten direct block entries, one single indirect block entry, one double indirect block entry and one triple indirect block entry? (A) 30 GB (B) 64 GB (C) 16 GB (D) 1 GB

Last Answer : (C) 16 GB

Description : The directory structure used in Unix file system is called (A) Hierarchical directory (B) Tree structured directory (C) Directed acyclic graph (D) Graph structured directory

Last Answer : (C) Directed acyclic graph

Description : ................. maintains the list of free disk blocks in the Unix file system. (A) I-node (B) Boot block (C) Super block (D) File allocation table

Last Answer : (C) Super block 

Description : A unix file may be of type: (A) Regular file (B) Directory File (C) Device File (D) Any one of the above 

Last Answer : (D) Any one of the above

Description : The Unix Kernel maintains two key data structures related to processes, the process table and the user structure. Which of following information is not the part of user structure? (A) File descriptor table (B) System call state (C) Scheduling parameters (D) Kernel stack

Last Answer : (C) Scheduling parameters

Description : In Unix operating system, special files are used to : (A) buffer data received in its input from where a process reads (B) provide a mechanism to map physical device to file names (C ... pointers associated with i-nodes (D) store information entered by a user application program or utility program

Last Answer : (B) provide a mechanism to map physical device to file names 

Description : A unix file system has 1-KB blocks and 4-byte disk addresses. What is the maximum file size if i-nodes contain 10 direct entries and one single, double and triple indirect entry each? (A) 32 GB (B) 64 GB (C) 16 GB (D) 1 GB

Last Answer : (C) 16 GB

Description : In Unix, the login prompt can be changed by changing the contents of the file ............... (A) contrab (B) init (C) gettydefs (D) inittab

Last Answer : Answer: C

Description : Which of the following information about the UNIX file system is not correct? (A) Super block contains the number of i-nodes, the number of disk blocks, and the start of the list of free disk blocks. (B ... Each i-node is 256-bytes long. (D) All the files and directories are stored in data blocks. 

Last Answer : (C) Each i-node is 256-bytes long.

Description : MOVE AX BX in this LINES OF CODE what type of error is declared: a. Undeclared identifier MOVE b. undeclared identifier AX c. Accept as a command d. Not look in symbol table

Last Answer : a. Undeclared identifier MOVE

Description : How to add the record number to each record in a file using awk command -Web-Development

Last Answer : answer:

Description : What is the Difference between file save and file save as command?

Last Answer : File Save As will always ask you for the name and location youwant to save the file as.If you already saved the file before,"File Save" will overwrite the previous file. Otherwise, it worksexactly the same as "File Save As".In other words, "File Save As" allows you to make a new copy ofyour file.

Description : What command would you use to create a backup control file?

Last Answer : Alter database backup control file to trace.

Description : What is the use of FILE option in IMP command ?

Last Answer : The name of the file from which import should be performed.

Description : What use of command line parameter cmd file?

Last Answer : It is a command line argument that allows you to specify a file that contain a set of arguments for r20run.

Description : How do you generate documentation from the C# file commented properly with a command-line compiler? 

Last Answer : Compile it with the /doc switch. 

Description : How do you generate documentation from the C# file commented properly with a command-line compiler?

Last Answer : Compile it with the /doc switch.

Description : In SQL, the command(s) is (are)used tocreate an index for atable or cluster A. CREATE INDEX B. MODIFY INDEX C. SET INDEX TO FILE D. All of theabove E. None of the above

Last Answer : CREATE INDEX

Description : The Assistant is -. 1) an application that allows you to take notes and save them in a file 2) an animated character that provides help and suggestions 3) a button on the standard Toolbar that executes the Print command 4) a collection of frequently misspelled words in a dictionary file

Last Answer : 2) an animated character that provides help and suggestions

Description : To find and load a file that has been saved - 1) select the Close command 2) select the New command 3) select the Save command 4) select the Open command

Last Answer : 4) select the Open command

Description : For creating a document, you use ..... command at File Menu. 1) Open 2) Close 3) New 4) Save

Last Answer : 3) New

Description : Which file in MS-DOS contains internal commands that are loaded during Booting process? 1) IO.SYS 2) MSDOS.SYS 3) COMMAND.COM 4) CONFIG.SYS

Last Answer : 4) CONFIG.SYS

Description : After booting process which file executes automatically 1) config.sys 2) command.com 3) autoexec.bat 4) io.sys

Last Answer : 3) autoexec.bat

Description : The hdfs command to create the copy of a file from a local system is a) CopyFromLocal b) copyfromlocal c) CopyLocal d) copyFromLocal

Last Answer : copyFromLocal

Description : Which file in MS-DOS contains internal commands that are loaded during Booting process? 1 IO.SYS 2 MSDOS.SYS 3 COMMAND.COM 4 CONFIG.SYS

Last Answer : 4 CONFIG.SYS

Description : After booting process which file executes automatically 1 config.sys 2 command.com 3 autoexec.bat 4 io.sys

Last Answer : 3 autoexec.bat

Description : Which command is used to display a file contents in octal form? A. cd B. od C. of D. oct E. None of the above

Last Answer : B. od

Description : Which command is used to count just the number of characters in a file? A. wc - 1 B. wc -c C. wc -w D. wc -r E. None of the above

Last Answer : B. wc -c

Description : Which command is used to remove a file? A. remove B. rm C. mv D. del E. None of the above

Last Answer : B. rm

Description : The command which transcribes the standard input to the standard output and also makes a copy of the same in a file is A. tee B. tr C. sort D. grep E. None of the above

Last Answer : A. tee

Description : The Octal number to be given alogn with chmod command to make a file readable, writable and executable to the owner, readable and executable to group and others is: A. 000 B. 755 C. 744 D. 555 E. None of the above

Last Answer : B. 755

Description : Which command is used to remove the read permission of the file 'note' from both the group and others? A. chmod go+r note B. chmod go+rw note C. chmod go-x note D. chmod go-r, 4-x note E. None of the above

Last Answer : D. chmod go-r, 4-x note