LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 09-30-2020, 02:39 AM   #1
salmanahmed
Member
 
Registered: Jun 2020
Posts: 158

Rep: Reputation: Disabled
View Configuration File


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
Attached Thumbnails
Click image for larger version

Name:	modemsettings.png
Views:	33
Size:	74.2 KB
ID:	34193  
 
Old 09-30-2020, 02:49 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,927

Rep: Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320
Quote:
Originally Posted by salmanahmed View Post
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 View Post
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 View Post
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.
 
1 members found this post helpful.
Old 09-30-2020, 03:35 AM   #3
salmanahmed
Member
 
Registered: Jun 2020
Posts: 158

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
probably would be better to say which one is it.

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?
 
Old 09-30-2020, 03:48 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,927

Rep: Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320
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).
 
1 members found this post helpful.
Old 09-30-2020, 05:06 AM   #5
salmanahmed
Member
 
Registered: Jun 2020
Posts: 158

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
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).
Thanks a lot.
 
Old 09-30-2020, 07:42 AM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
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?

Otherwise, what's the point of creating a backup?
 
1 members found this post helpful.
Old 09-30-2020, 07:57 AM   #7
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,611
Blog Entries: 19

Rep: Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458
Following on from what pan64 said:

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.
 
1 members found this post helpful.
Old 09-30-2020, 10:22 AM   #8
salmanahmed
Member
 
Registered: Jun 2020
Posts: 158

Original Poster
Rep: Reputation: Disabled
@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
 
Old 09-30-2020, 10:28 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,927

Rep: Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320
Quote:
Originally Posted by salmanahmed View Post
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).
 
1 members found this post helpful.
Old 09-30-2020, 10:50 AM   #10
salmanahmed
Member
 
Registered: Jun 2020
Posts: 158

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
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 :-(
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
KDE Konqueror View Mode Icons (Image Preview/Tree View) sadarax Linux - General 7 06-27-2006 12:45 PM
how to view movies that only windows media player can view? servnov Linux - General 7 02-08-2006 10:42 AM
In addition to "view new posts" about "View last 24 hours" KimVette LQ Suggestions & Feedback 3 10-30-2005 10:22 AM
W2K cannot view samba share but can view NT FiveFlat Linux - Software 3 06-10-2005 02:54 PM
View more than 25 threads on the "view new posts" page lfslinux LQ Suggestions & Feedback 2 02-02-2002 12:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration