Update README.md
This commit is contained in:
90
README.md
90
README.md
@@ -1,36 +1,80 @@
|
|||||||
[](https://github.com/pavliktt/fileinfo/actions/workflows/c-cpp.yml)
|
[](https://github.com/pavliktt/fileinfo/actions/workflows/c-cpp.yml)
|
||||||
<h1>fileinfo</h1>
|
# fileinfo
|
||||||
A simple C++ program that displays information about files and folders.
|
A simple C++ program that displays information about files and folders.
|
||||||
<h2>Contents</h2>
|
## Contents
|
||||||
|
|
||||||
* [Installation](#installation)
|
* [Installation](#installation)
|
||||||
* [Usage](#usage)
|
* [Usage](#usage)
|
||||||
* [Example](#example)
|
* [Example](#example)
|
||||||
<h2>Installation</h2>
|
## Installation
|
||||||
First, install libmagic-dev:<br>
|
If you want the program to detect the file type more accurately, install `libmagic-dev` through your package manager, or with the `./configure` command
|
||||||
<pre>
|
<br>
|
||||||
sudo apt install libmagic-dev
|
If you haven't installed `libmagic-dev`, please add this line to the very top of `main.cpp`:
|
||||||
</pre>
|
```c++
|
||||||
Or, you can just run<br>
|
#define NO_MIME
|
||||||
<pre>
|
```
|
||||||
./configure
|
Then, compile the source code.<br>
|
||||||
</pre>
|
```
|
||||||
Now, compile the source code.<br>
|
|
||||||
<pre>
|
|
||||||
make
|
make
|
||||||
</pre>
|
```
|
||||||
And finally, copy that executable to /usr/local/bin folder. (not required)<br>
|
And finally, copy that executable to /usr/local/bin folder. (not required)<br>
|
||||||
<pre>
|
```
|
||||||
sudo cp fileinfo /usr/local/bin/
|
sudo cp fileinfo /usr/local/bin/
|
||||||
</pre>
|
```
|
||||||
<h2>Usage</h2>
|
## Usage
|
||||||
<pre>
|
```
|
||||||
./a.out [args] filename ...
|
./a.out [args] filename ...
|
||||||
Args:
|
Args:
|
||||||
-A Output absolute path
|
-A Output absolute path
|
||||||
-E Do not show emojis
|
-E Do not show emojis
|
||||||
</pre>
|
```
|
||||||
<h2>Example</h2>
|
## Example
|
||||||
<pre>
|
```
|
||||||
pavlik@pavlik-MacBookPro9-2:~/rgb-terminal$ ls<br/>LICENSE main.c README.md<br/>pavlik@pavlik-MacBookPro9-2:~/rgb-terminal$ fileinfo main.c # Single file<br/>📝 main.c:<br/> Name: main.c<br/> Type: Text<br/> MIME: text/x-c<br/> File size: 10.1 KB or 9.9 KiB (10110 bytes)<br/> Permissions: -rw-rw-r--<br/>pavlik@pavlik-MacBookPro9-2:~/rgb-terminal$ fileinfo main.c -A # Single file with argument<br/>📝 main.c:<br/> Name: main.c<br/> Type: Text<br/> Absolute path: /home/pavlik/rgb-terminal/main.c<br/> MIME: text/x-c<br/> File size: 10.1 KB or 9.9 KiB (10110 bytes)<br/> Permissions: -rw-rw-r--<br/>pavlik@pavlik-MacBookPro9-2:~/rgb-terminal$ fileinfo * # All files in this directory<br/>📝 LICENSE:<br/> Name: LICENSE<br/> Type: Text<br/> MIME: text/plain<br/> File size: 1.2 KB or 1.2 KiB (1211 bytes)<br/> Permissions: -rw-rw-r--<br/><br/>📝 main.c:<br/> Name: main.c<br/> Type: Text<br/> MIME: text/x-c<br/> File size: 10.1 KB or 9.9 KiB (10110 bytes)<br/> Permissions: -rw-rw-r--<br/><br/>📝 README.md:<br/> Name: README.md<br/> Type: Text<br/> MIME: text/plain<br/> File size: 173 bytes<br/> Permissions: -rw-rw-r--<br/>pavlik@pavlik-MacBookPro9-2:~/rgb-terminal$ fileinfo . # Current directory<br/>📁 rgb-terminal/:<br/> Name: rgb-terminal/<br/> Type: Folder<br/> MIME: inode/directory<br/> Contents:<br/> Normal: 3 files and 0 folders.<br/> Hidden: 0 files and 1 folders.<br/> Permissions: drwxrwxr-x
|
pavlik@pavlik-MacBookPro9-2:~/rgb-terminal$ ls
|
||||||
</pre>
|
LICENSE main.c README.md
|
||||||
|
pavlik@pavlik-MacBookPro9-2:~/rgb-terminal$ fileinfo main.c # Single file
|
||||||
|
📝 main.c:
|
||||||
|
Name: main.c
|
||||||
|
Type: Text
|
||||||
|
MIME: text/x-c
|
||||||
|
File size: 10.1 KB or 9.9 KiB (10110 bytes)
|
||||||
|
Permissions: -rw-rw-r--
|
||||||
|
pavlik@pavlik-MacBookPro9-2:~/rgb-terminal$ fileinfo main.c -A # Single file with argument
|
||||||
|
📝 main.c:
|
||||||
|
Name: main.c
|
||||||
|
Type: Text
|
||||||
|
Absolute path: /home/pavlik/rgb-terminal/main.c
|
||||||
|
MIME: text/x-c
|
||||||
|
File size: 10.1 KB or 9.9 KiB (10110 bytes)
|
||||||
|
Permissions: -rw-rw-r--
|
||||||
|
pavlik@pavlik-MacBookPro9-2:~/rgb-terminal$ fileinfo * # All files in this directory
|
||||||
|
📝 LICENSE:
|
||||||
|
Name: LICENSE
|
||||||
|
Type: Text
|
||||||
|
MIME: text/plain
|
||||||
|
File size: 1.2 KB or 1.2 KiB (1211 bytes)
|
||||||
|
Permissions: -rw-rw-r--
|
||||||
|
|
||||||
|
📝 main.c:
|
||||||
|
Name: main.c
|
||||||
|
Type: Text
|
||||||
|
MIME: text/x-c
|
||||||
|
File size: 10.1 KB or 9.9 KiB (10110 bytes)
|
||||||
|
Permissions: -rw-rw-r--
|
||||||
|
|
||||||
|
📝 README.md:
|
||||||
|
Name: README.md
|
||||||
|
Type: Text
|
||||||
|
MIME: text/plain
|
||||||
|
File size: 173 bytes
|
||||||
|
Permissions: -rw-rw-r--
|
||||||
|
pavlik@pavlik-MacBookPro9-2:~/rgb-terminal$ fileinfo . # Current directory
|
||||||
|
📁 rgb-terminal/:
|
||||||
|
Name: rgb-terminal/
|
||||||
|
Type: Folder
|
||||||
|
MIME: inode/directory
|
||||||
|
Contents:
|
||||||
|
Normal: 3 files and 0 folders.
|
||||||
|
Hidden: 0 files and 1 folders.
|
||||||
|
Permissions: drwxrwxr-x
|
||||||
|
```
|
||||||
|
Reference in New Issue
Block a user