Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi
I have made a backup of my internet modem settings. The settings file is saved by name "backupsettings.conf". The name of the file shows that it is a configuration file and a type of text file. However, when I try to open this file from "nano", it shows unrecognized characters (please see attached screenshot). So, kindly recommend me some applications which I can try to view this file.
Thanks
I have made a backup of my internet modem settings. The settings file is saved by name "backupsettings.conf".
probably would be better to say which one is it.
Quote:
Originally Posted by salmanahmed
The name of the file shows that it is a configuration file and a type of text file.
That is false. If you want to know the type of the file you need to use the command file. The name/extension of the file has no any particular meaning in the linux world.
Code:
file backupsettings.conf
Quote:
Originally Posted by salmanahmed
However, when I try to open this file from "nano", it shows unrecognized characters (please see attached screenshot). So, kindly recommend me some applications which I can try to view this file.
Thanks
it looks like it is a binary file and I'm afraid it cannot be viewed that way.
That is false. If you want to know the type of the file you need to use the command file. The name/extension of the file has no any particular meaning in the linux world.
Code:
file backupsettings.conf
it looks like it is a binary file and I'm afraid it cannot be viewed that way.
"file" command shows that it is a data file:
Code:
(slu:lap:~/Downloads) file backupsettings.conf
backupsettings.conf: data
And, if it is a binary file, then what are my options to view/investigate it?
without knowing the internal structure there is no way to view it.
You can try a hex viewer or some other tools to analyze it, but I'm afraid you will find no usable information (without documentation).
without knowing the internal structure there is no way to view it.
You can try a hex viewer or some other tools to analyze it, but I'm afraid you will find no usable information (without documentation).
It's weird that a file with this type of extension is binary. Assuming they coded it somehow which makes sense to them. Which is fine, that's their affair. You can load it in emacs and enter hexl-mode to see the hex, not that, that will be any more highly readable.
I'm more concerned if what you did was something you can confirm effectively:
Have you confirmed that if you change your modem settings, and then restore from this backup, that it works?
In Linux and Unix generally, filename suffixes are arbitrary. They may or may not reflect the actual file type. This is determined by the "magic number", the characteristic sequence of bytes with which all files of a certain type begin. Despite its name, it's not always a number; for example html files begin with <html>. A database on your system lists all the file types and their corresponding magic numbers, and the file command interrogates it to determine the actual type of the file. If the type isn't found, the file is assumed to be a binary data file of an unspecified type, and the file command reports "data".
It's a much saner system than depending on the filename suffix as Windows does. I once worked as a volunteer in a library where someone who didn't really understand computers thought she could interconvert different graphical file formats by just changing the file suffix. The result was that no graphical program could read those files. They clearly weren't what their filename suffix suggested, but the programs had no way of finding out what they actually were. In Linux, a graphical program can quickly determine the real type of a misnamed file simply by checking its magic number.
@rtmistler: I am trying to tweak my modem settings. That's why, before any tinkering, I have made a backup copy, so in case of messed up settings, I can restore them. And it helped, as I messed up and had to restore from this "backupsettings.conf". Then I was thinking that, is there any way I can read this "backupsettings.conf" file, so I must not mess next time.
I installed ghex and open it but no help. I think the ISP deliberately saved this file in this format in order to protect it, from people like me :-(
@hazel: Your library story is funny, thanks for sharing
I installed ghex and open it but no help. I think the ISP deliberately saved this file in this format in order to protect it, from people like me :-(
Most probably it is a simple memory dump, there is no need to parse it, just save and overwrite. That is the cheapest solution, no parser, no checker or validator required.
But [obviously] you need to know the software to really know it (and to be able to alter it).
Most probably it is a simple memory dump, there is no need to parse it, just save and overwrite. That is the cheapest solution, no parser, no checker or validator required.
But [obviously] you need to know the software to really know it (and to be able to alter it).
Yes, you are right. Until I know that which closed-source (evil) software they have used, I am out of luck :-(
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.