File

Synopsis

File is a standard program for recognizing the type of data contained in a computer file. The file command attempts to classify each file system object (i.e., file, directory or link) that is provided to it as an argument (i.e., input). File tests each argument in an attempt to classify it. There are three sets of tests, performed in this order: file system tests, magic number tests, and language tests.

The first is a file system test, which uses the stat system call to obtain information from the object’s inode (which contains information about a file).

The second test checks to see if there is a magic number, which is a number embedded at or near the beginning of many types of files that indicates the file format (i.e., the type of file).

In the event that the first two tests fail to determine the type of a file, language tests are employed to determine if it is plain text (i.e., composed entirely of human-readable characters), and, if so, what type of plain text, such as HTML (hypertext markup language) or source code

Help Command

This command helps to determine the usage of file module. The user will come to know about the different ways/format to execute this module. This command guides the end user to know the purpose of this command. Below given are the command and the screenshot of the same.

cleopatra file help

Create

When the user needs to Create a new system file, the below given command will execute the process.

cleopatra file create --file="somename"

The below given commands overwrite files that exist

cleopatra file create --file="somename” --overwrite-existing

The below given command for write the data in the file

cleopatra file create –file="somename” --data="things to put in the file"

Delete

When the user needs to delete a system file, the below given command will execute the process.

cleopatra file delete --file="somename"

Exists

When the user needs to check the existence of a file, the below given command will execute the process.

cleopatra file exists --filename="somename"

Append

When the user needs to append a line to a file, the below given command will execute the process.

cleopatra file append --filename="somename" --line="a line"
  • Line option – you can insert a line to be appended

Should-have-line

When the user needs to ensure that a file contains a particular line, the below given command will execute the process.

cleopatra file should-have-line --filename="somename" --line="a line"
  • Line option – Statement that needs to be checked

Options

Parameters Alternative Parameter Comments
Cleopatra file help Either of the two alternative parameter can be used in command- File, file eg: Cleopatra File Install/ Cleopatra file Install| Once the user provides the option, System starts processing

Benefits

  • Specify a file specially formatted containing position-sensitive tests; default position-sensitive tests and context-sensitive tests will not be performed.
comments powered by Disqus

Edit this document!

This file can be edited directly through the Web. Anyone can update and fix errors in this document with few clicks -- no downloads needed.

  1. Go to File on GitHub.
  2. Edit files using GitHub's text editor in your web browser (see the 'Edit' tab on the top right of the file)
  3. Fill in the Commit message text box at the bottom of the page describing why you made the changes. Press the Propose file change button next to it when done.
  4. Then click Send a pull request.
  5. Your changes are now queued for review under the project's Pull requests tab on GitHub!

For an introduction to the documentation format please see the reST primer.