LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 10-29-2009, 02:34 AM   #1
Komal_rg
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Rep: Reputation: 0
'sudo' cant list "/root/install*" ??


Hello all...

Why is this happening this way?
Though the files exist(install.log.syslog and install.log) and I am executing the command using sudo, it is not listing when I try listing using glob...

$ sudo ls /root/install*
ls: /root/install*: No such file or directory

$ sudo ls /root/
anaconda-ks.cfg
Desktop
install.log.syslog
install.log
prov

But i can do it if i switch as root user and do it..

$ su -
Password:
# ll install*
-rw-r--r-- 1 root root 43521 Sep 5 22:51 install.log
-rw-r--r-- 1 root root 5947 Sep 5 22:51 install.log.syslog

Why is this??
 
Old 10-29-2009, 02:42 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Are not you using two different commands? ls will try to list files in directory /root/install. So its expecting install to be a directory.
Try

sudo ll /root/install*
 
Old 10-29-2009, 02:52 AM   #3
mobinskariya
Member
 
Registered: Sep 2007
Location: Kerala, India
Distribution: ubuntu 10.04
Posts: 367

Rep: Reputation: 55
correct me if im wrong..here is what i get
Code:
[mobin@localhost ~]$ ls
anaconda-ks.cfg  Desktop  install.log  install.log.syslog  prov
[mobin@localhost ~]$ ls install*
install.log  install.log.syslog
i think the ls command should list all the files and directories starting with install*..if it is a directory it will also display its contents.
 
Old 10-29-2009, 03:18 AM   #4
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
May be it depends on the distribution. On my Ubuntu it does not work that way.

sudo ls /root/pin*.* gives error.
Will check with CentOS.
 
Old 10-29-2009, 03:27 AM   #5
Komal_rg
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by linuxlover.chaitanya View Post
Are not you using two different commands? ls will try to list files in directory /root/install. So its expecting install to be a directory.
Try

sudo ll /root/install*

ll is just an alias for "ls -l".

However, i tried

sudo ll /root/install*

Its still the same error.
 
Old 10-29-2009, 03:29 AM   #6
Komal_rg
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by mobinskariya View Post
correct me if im wrong..here is what i get
Code:
[mobin@localhost ~]$ ls
anaconda-ks.cfg  Desktop  install.log  install.log.syslog  prov
[mobin@localhost ~]$ ls install*
install.log  install.log.syslog
i think the ls command should list all the files and directories starting with install*..if it is a directory it will also display its contents.



Thats correct.
But I am tring to list the files in /root directory. As a regular user i do not have the permission. So using sudo.
 
Old 10-29-2009, 04:47 AM   #7
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Ok just try sudo ls /root. This should definitely work.
 
  


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
echo "hahaha" | sudo tee /root/reallyimportantstuff crispyleif Linux - Security 7 01-24-2009 12:51 PM
Error installing No-IP Client, "sudo make install" not working ACSUSA Ubuntu 2 06-27-2008 09:06 AM
cannot "sudo apt-get uptate" or "sudo" anything! plz help mdguy21061 Linux - Newbie 7 04-14-2008 12:59 AM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 11:18 PM
sudo stopped working: "must be setuid root" quincy_the_penquin Linux - Software 4 04-30-2007 07:37 AM


All times are GMT -5. The time now is 03:32 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