fileinfo/README.md

32 lines
2.9 KiB
Markdown
Raw Normal View History

2024-08-22 02:49:44 +05:30
[![C/C++ CI](https://github.com/pavliktt/fileinfo/actions/workflows/c-cpp.yml/badge.svg)](https://github.com/pavliktt/fileinfo/actions/workflows/c-cpp.yml)
2024-08-20 23:11:53 +05:30
<h1>fileinfo</h1>
2024-08-20 23:09:18 +05:30
A simple C++ program that displays information about files and folders.
2024-08-20 23:37:33 +05:30
<h2>Installation</h2>
First, install libmagic-dev:<br>
<pre>
sudo apt install libmagic-dev
2024-08-22 14:40:28 +05:30
</pre>
2024-08-22 14:39:11 +05:30
Or, you can just run<br>
<pre>
./configure
2024-08-22 14:40:28 +05:30
</pre>
Now, compile the source code.<br>
2024-08-20 23:37:33 +05:30
<pre>
2024-08-22 14:39:11 +05:30
make
2024-08-22 14:40:28 +05:30
</pre>
2024-08-22 02:31:03 +05:30
And finally, copy that executable to /usr/local/bin folder. (not required)<br>
2024-08-20 23:37:33 +05:30
<pre>
sudo cp fileinfo /usr/local/bin/
</pre>
2024-08-20 23:11:53 +05:30
<h2>Usage</h2>
2024-08-20 23:12:13 +05:30
<pre>
2024-08-20 23:11:53 +05:30
./a.out [args] filename ...<br>
Args:<br>
-A Output absolute path<br>
-E Do not show emojis<br>
2024-08-20 23:12:13 +05:30
</pre>
2024-08-22 02:31:03 +05:30
<h2>Example</h2>
<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/>&nbsp;&nbsp;&nbsp;&nbsp;Name: main.c<br/>&nbsp;&nbsp;&nbsp;&nbsp;Type: Text<br/>&nbsp;&nbsp;&nbsp;&nbsp;MIME: text/x-c<br/>&nbsp;&nbsp;&nbsp;&nbsp;File size: 10.1 KB or 9.9 KiB (10110 bytes)<br/>&nbsp;&nbsp;&nbsp;&nbsp;Permissions: -rw-rw-r--<br/>pavlik@pavlik-MacBookPro9-2:~/rgb-terminal$ fileinfo main.c -A # Single file with argument<br/>📝 main.c:<br/>&nbsp;&nbsp;&nbsp;&nbsp;Name: main.c<br/>&nbsp;&nbsp;&nbsp;&nbsp;Type: Text<br/>&nbsp;&nbsp;&nbsp;&nbsp;Absolute path: /home/pavlik/rgb-terminal/main.c<br/>&nbsp;&nbsp;&nbsp;&nbsp;MIME: text/x-c<br/>&nbsp;&nbsp;&nbsp;&nbsp;File size: 10.1 KB or 9.9 KiB (10110 bytes)<br/>&nbsp;&nbsp;&nbsp;&nbsp;Permissions: -rw-rw-r--<br/>pavlik@pavlik-MacBookPro9-2:~/rgb-terminal$ fileinfo * # All files in this directory<br/>📝 LICENSE:<br/>&nbsp;&nbsp;&nbsp;&nbsp;Name: LICENSE<br/>&nbsp;&nbsp;&nbsp;&nbsp;Type: Text<br/>&nbsp;&nbsp;&nbsp;&nbsp;MIME: text/plain<br/>&nbsp;&nbsp;&nbsp;&nbsp;File size: 1.2 KB or 1.2 KiB (1211 bytes)<br/>&nbsp;&nbsp;&nbsp;&nbsp;Permissions: -rw-rw-r--<br/><br/>📝 main.c:<br/>&nbsp;&nbsp;&nbsp;&nbsp;Name: main.c<br/>&nbsp;&nbsp;&nbsp;&nbsp;Type: Text<br/>&nbsp;&nbsp;&nbsp;&nbsp;MIME: text/x-c<br/>&nbsp;&nbsp;&nbsp;&nbsp;File size: 10.1 KB or 9.9 KiB (10110 bytes)<br/>&nbsp;&nbsp;&nbsp;&nbsp;Permissions: -rw-rw-r--<br/><br/>📝 README.md:<br/>&nbsp;&nbsp;&nbsp;&nbsp;Name: README.md<br/>&nbsp;&nbsp;&nbsp;&nbsp;Type: Text<br/>&nbsp;&nbsp;&nbsp;&nbsp;MIME: text/plain<br/>&nbsp;&nbsp;&nbsp;&nbsp;File size: 173 bytes<br/>&nbsp;&nbsp;&nbsp;&nbsp;Permissions: -rw-rw-r--<br/>pavlik@pavlik-MacBookPro9-2:~/rgb-terminal$ fileinfo . # Current directory<br/>📁 rgb-terminal/:<br/>&nbsp;&nbsp;&nbsp;&nbsp;Name: rgb-terminal/<br/>&nbsp;&nbsp;&nbsp;&nbsp;Type: Folder<br/>&nbsp;&nbsp;&nbsp;&nbsp;MIME: inode/directory<br/>&nbsp;&nbsp;&nbsp;&nbsp;Contents:<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Normal: 3 files and 0 folders.<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hidden: 0 files and 1 folders.<br/>&nbsp;&nbsp;&nbsp;&nbsp;Permissions: drwxrwxr-x
</pre>