Describe cat and rm file handling commands with example.

1 Answer

Answer :

cat Command: Cat(concatenate) command is very frequently used in Linux. It reads data from the file and gives their content as output. It helps us to create, view, concatenate files.

cat is used to display the contents of file. To do that for the file stu.txt, simply specify the filename as the argument: cat stu.txt 

cat is also useful for creating a file. Enter the command cat, followed by the ‘>’ character and the filename ( for ex. abc) and press the key. Enter text messages and then press :

$ cat > abc

This is simple text file.

Cat is used to represent a rudimentary editor.

<control-d>

$_


cat is also used to append the content in to existing file. Example: cat >> abc 
Copy the contents of one file to another file using cat command: cat file1 > file2
Rm command: rm stands for remove here. rm command is used to remove objects such as files, directories, symbolic links and so on from the file system like UNIX.
Files can be deleted with rm (remove). The following command deletes the first three chapters of the text.
$ rm chap1 chap2 chap3
$_
You can easily deletes all files in directory by
$ rm *
$_

Options of rm
rm –i: the -i option makes the command ask the user for confirmation before removing each file, you have to press y for confirm deletion, any other key leaves the file un-deleted.
$ rm -i stu.txt
rm: remove regular empty file 'stu.txt'? y
rm –r: With -r(or -R) option rm command performs a tree-walk and will delete all the files and sub-directories recursively of the parent directory.
$ rm -r 

Related questions

Description : Describe working of diff and cmp file handling commands with example.

Last Answer : Diff command: diff stands for difference. This command is used to display the differences in the files by comparing the files line by line. it tells us which lines in one file have is to be changed to make the two files ... $ cat file1 abcd xyz $ cat file2 Abed wxy $_  

Description : Which of the following commands is used to update access and modification times of a file? A. grep B. wc C. touch D. cat E. None of the above

Last Answer : C. touch

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 : Describe use of following commands with example: i) route ii) net stat

Last Answer : Route: Packets are transmitted from one computer to another. The route determines where the process starts and what computer system needs to send the packet for it to reach its destination. In ... or softwaredefined network interface) and network protocol statistics. Options of Netstat:

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 : 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 : With suitable example, explain CpiO and tar commands. 

Last Answer : cpio: The cpio command is one of standard Unix backup utilities. It stands for "copy in/out." It is much less well known and more rarely used Unix utility in comparison with tar. ... command creates the file archive test.tar from the two uncompressed files test1 and test2. 

Description : What is the rm of cable ?

Last Answer : In the case of electric cables or their wires, rm means that the conductor of the wire is round. rm = Stranded Round Conductors

Description : In which step of the five steps RM process is the analysis conducted?

Last Answer : In which step of the five steps RM process is the METT-TCanalysis conducted?

Description : What is the intersection of the assesed probability and severity of a hazard called in the rm process?

Last Answer : Need answer

Description : What year is my rm 125 VIN JS1RF15A000500961?

Last Answer : Need answer

Description : Filtrate flow rate in case of a rotary drum vacuum filter (in which Rm < < Rc ) is proportional to __________ and the cycle time (where, μ = filtrate viscosity Rm = filter medium resistance Rc = cake resistance). (A) √μ (B) 1/√μ (C) 1/μ (D) 1/μ

Last Answer : (B) 1/√μ

Description : If Rm is the minimum reflux ratio, the optimum reflux ratio may be around __________ Rm. (A) 1.2 to 1.5 (B) 2.5 to 3 (C) 3 to 4 (D) 5

Last Answer : (A) 1.2 to 1.5

Description : Let L be the language generated by regular expression 0*10* and accepted by the deterministic finite automata M. Consider the relation RM defined by M. As all states are reachable from the start state, RM has ................ equivalence classes. (A) 2 (B) 4 (C) 5 (D) 6

Last Answer : (D) 6

Description : Write the general formats for file opening and file closing commands?

Last Answer : Ans: For Opening:- fp=fopen(“filename” , “mode”); where ‘fp’ refers to the file pointer. ‘filename’ refers to the name of the file to be opened. ‘mode’ refers to the mode of accessing data. For Closing:- fclose(fp); where fp denotes the file pointer.

Description : GO BOTTOM and SKIP-3 commands are given one after another in a database file of 30 records. It shifts the control to (A) 28th record (B) 27th record (C) 3rd record (D) 4th record

Last Answer : (B) 27th record

Description : In gw basic what are the two types of file handling?

Last Answer : Sequential and random access.

Description : Why we use File Handling?

Last Answer : Ans: The input and output operation that we have performed so far were done through screen and keyboard only.After the termination of program all the entered data is lost because primary memory is volatile ... 2. Low level (system oriented files)- low level files handling is managed by system call.

Description : The ALU of a computer responds to the commands coming from A) Primary memory B) Control section C) External memory D) Cache memory

Last Answer : Answer : B

Description : Which is an escape code language used to send commands to the printer for printing documents? A. Postscript B. PCL C. Both (A) and (B) D. None of the Above

Last Answer : B. PCL

Description : _________ is a group of commands for a CPU in machine language. A. Information Set B. Instruction Set C. Buffer D. None of the Above

Last Answer : B. Instruction Set

Description : The toolbar which contains short cuts to some of the most frequently used commands found under the FORMAT menu item is: a) Standard Toolbar b) Status Bar c) Formatting Toolbar d) None of These

Last Answer : c) Formatting Toolbar

Description : ________toolbar contains short cuts to some of the most frequently used commands from the menu bar: a) Formatting Toolbar b) Standard Toolbar c) Both of Above d) None of These

Last Answer : b) Standard Toolbar

Description : ______bar displays the heading for each drop down menu. Commands are grouped under each of these menu headings according to function: a) Title Bar b) Formatting Toolbar c) Menu bar d) None of These

Last Answer : c) Menu bar

Description : Which among the following is correct about WRAM: a) Makes it easier to allow blocks of memory to be addressed with just a few commands b) Makes it easier to allow windows of memory to be addressed with just a few commands. c) Both of Above d) None of These

Last Answer : c) Both of Above

Description : _______is the process of carrying commands: a) Storing b) Executing c) Fetching d) None of These

Last Answer : b) Executing

Description : ______toolbar contains short cuts to some of the most frequently used commands from the menu bar: a) Standard b) Title c) Status Bar d) None of These

Last Answer : a) Standard

Description : Which among the following print commands should be selected to print first 5 pages of document: a) Page Setup b) Print All c) From ___to ____ d) None of The Above

Last Answer : c) From ___to ____

Description : ________ is the process of carrying commands. a) Fetching b) Storing c) Executing d) Decoding e) None of these

Last Answer : c) Executing

Description : Which of the following commands is given to reboot the computer? 1) Ctrl + Alt + Del 2) Ctrl + Alt + Tab 3) Ctrl + Shift + Del 4) Ctrl + Alt + shift

Last Answer : 1) Ctrl + Alt + Del

Description : A ..... contains buttons and menus that provide quick access to commonly used commands. 1) Menu Bar 2) Toolbar 3) Window 4) Action Bar

Last Answer : 2) Toolbar

Description : The.... of software contains list lists of commands and options. 1) Menu bar 2) Title bar 3) Formula bar 4) Tool bar

Last Answer : 1) Menu bar

Description : Which type of commands in DOS needs additional files for their execution? 1) Internal Commands 2) External Commands 3) Batch Commands 4) Redirector

Last Answer : 2) External Commands

Description : Which of the following commands displays names of files in sorted order? 1) DIR/N 2) DIR/SO 3) DIR/AN 4) DIR/AH

Last Answer : 3) DIR/AN

Description : Which type of commands in DOS needs additional files for their execution? 1 Internal Commands 2 External Commands 3 Batch Commands 4 Redirectors

Last Answer : 2 External Commands

Description : Which of the following commands displays names of files in sorted order? 1 DIR/N 2 DIR/SO 3 DIR/AN 4 DIR/AH

Last Answer : 3 DIR/AN

Description : . Which attack is an HTTP attack which allows attackers to access restricted directories and execute commands outside the web servers root directory? a. XSS attack b. Path Traversal attack c. MITM attack d. SQL Injection attack

Last Answer : d. SQL Injection attack

Description : Write the output for the following commands: (i) ls –a (ii) date “+%D”

Last Answer : i) ls –a : list all files including hidden files. These are files that start with “.”. ii) date “+%D” : Display date as mm/dd/yy. output: 11/26/19

Description : Define internal and external commands.

Last Answer : Internal Commands: Commands which are built into the shell. For all the shell built-in commands, execution of the same is fast in the sense that the shell doesn't have to search the given path for them in ... usually is at /usr/bin, the executable /usr/bin/cat gets executed. Examples: ls, cat etc. 

Description : Which of the following commands is called as three-finger salute in computers ? (1) Ctrl + Alt + Delete (2) Ctrl + Shift + Escape (3) Ctrl + Shift + Enter (4) Ctrl + Alt + Arrow key

Last Answer : Ctrl + Alt + Delete

Description : Describe various principles of material handling in details.

Last Answer : A) Related to planning. - All activity should be planned. - Plan a system which include all the handling activities & co-coordinating the operations. - Simplification ... Performance efficiency principle: Determine efficiency of material handling performance in terms of expense per unit handled.

Description : Trying to make someone else accept blame for a problem is an example of which conflict-handling orientation? (a) competing ; (b) avoiding ; (c) accommodating ; (d) compromising

Last Answer : (a) competing ;

Description : Describe Hierarchical file system.

Last Answer : All files in UNIX are related to one another. The file system in UNIX is a collection of all these related files organised in a hierarchical (an inverted tree) structure. This system ... service. Contains server specific services related data. For example, /srv/cvs contains CVS related data. 

Description : Do speech commands, or speech to text apps help or hurt our actual speech abilities?

Last Answer : answer:My speech skills are impeccable. Siri loves me.

Description : Can you help me with some very basic puppy training commands?

Last Answer : You could either take her to a class near you such as the ones at Pet Smart or search google for some videos on training. I saw a few out there and one was from IAMS, one from Purina, and I'm ... system. Everytime she does something you want her to do, give her a treat and a loving pat on the head.

Description : Where can I learn all Terminal commands in Ubuntu?

Last Answer : answer:http://ss64.com/bash/ https://www.google.com/search?q=a-z+list+of+linux+commands

Description : Can you teach me the 'If' commands in Excel?

Last Answer : answer:You don't really need an IF function here. Let me introduce you to another one that's great for use with dates: DATEDIFF, which gives the difference between dates depending on the parameter ... contains this function, which is very simple. Send a follow-up message if you need that assistance.

Description : I put myself as a OP on a server for minecraft and none of the commands are working what do I do?

Last Answer : answer:Make sure you’re putting the / before your server commands, of course. Otherwise, try and restart the server. Some changes like enabling monsters take time and a few restarts occasionally.