LinuxQuestions.org
Help answer threads with 0 replies.
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 11-28-2014, 05:21 AM   #1
JKF22
LQ Newbie
 
Registered: Nov 2014
Posts: 4

Rep: Reputation: Disabled
Editing File Shows Random Characters


Hi all, sorry if this a serious newbie one but...

I've just got a new Linux VPS install running Centos, i wanted to make changes to the /usr/sbin/visudo file.

When i do a 'nano /usr/sbin/visudo' i just get a load of random chars load, the file is unusable.

A message appears at the bottom of the file when it opens saying 'converted from DOS and Mac format'. But when i see via the nano edit is:

^?ELF^B^A^A^@^@^@^@^@^@^@^@^@^C^@>^@^A^@^@^@�? for line after line.

Does anyone know what this is, why the editor or server isn't loading the file properly? Or what i can do to fix this.

Many thanks.
 
Old 11-28-2014, 05:34 AM   #2
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 17.3 and 18.2 at present.
Posts: 1,297

Rep: Reputation: 302Reputation: 302Reputation: 302Reputation: 302
Files in /usr/sbin are executable files rather than scripts so you're likely to get what looks like rubbish, they're binary, the clue's in the directory name.

Try
Code:
$cat | more /usr/sbin/visudo
which will also be unintelligible, mainly unprintable characters.

For information, visudo is the command used to edit the sudoer's file, why do you want to edit it, the command that is?

Play Bonny!


Last edited by Soadyheid; 11-28-2014 at 05:38 AM. Reason: query
 
1 members found this post helpful.
Old 11-28-2014, 05:38 AM   #3
JKF22
LQ Newbie
 
Registered: Nov 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks, its still early and my brain isn't switched on yet.

So opening the file via nano / vi like did wasn't right... just punching in /usr/sbin/visudo then opened it as expected in the VI editor.

Thanks again.
 
Old 11-28-2014, 08:54 AM   #4
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 665

Rep: Reputation: Disabled
visudo is used to edit the sudoers file, why in the world are you trying to open it with vi ?
well if it was for some kind of learning .. use
Code:
'strings <filename>'
to read binary files.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Editing sudoers (shows as new file in nano) rushinblue Linux - Newbie 2 11-06-2007 02:17 PM
Font characters disappear at random Rekna Linux - General 5 09-10-2007 07:00 PM
using /dev/random to output random numbers on a text file guguma Programming 4 04-02-2007 02:42 PM
random characters sent to sandard output with bttv drivers slzckboy Linux - Hardware 0 11-12-2005 10:16 AM
random characters in editor forand *BSD 0 12-12-2002 01:17 PM

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

All times are GMT -5. The time now is 07:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration