LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 06-01-2011, 09:53 PM   #1
Red Squirrel
Member
 
Registered: Dec 2003
Distribution: FC9 on main server
Posts: 820

Rep: Reputation: 36
How to use su with arguments?


How to I use su to run a command, and pass arguments to that command, and not su?

ex:

Code:
su vmuser VBoxManage -q list runningvms
I want -q to be specified to the VBoxManage command, not su. If I try any type of quotes it does not work either. Is there a way to do this?
 
Old 06-01-2011, 09:58 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Rep: Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096
The correct way would be
Code:
su vmuser -c 'VBoxManage -q list runningvms'
You need the -c option to run commands with su.

For more information about the usage of su have a look at
Code:
man su
 
1 members found this post helpful.
Old 06-01-2011, 10:07 PM   #3
Red Squirrel
Member
 
Registered: Dec 2003
Distribution: FC9 on main server
Posts: 820

Original Poster
Rep: Reputation: 36
Ahh I see, that worked, thanks!
 
Old 06-01-2011, 10:12 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Rep: Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096Reputation: 4096
If your problem is solved please mark this thread as solved using the thread tools at the top of this thread.
 
  


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
[SOLVED] [: too many arguments hd_pulse Programming 2 05-26-2011 02:35 PM
make arguments johnrage Suse/Novell 2 11-29-2005 09:10 AM
What do these kernel arguments mean? TruongAn Linux - Software 2 10-20-2005 10:22 AM
Kernel arguments? ace_bandit_1 Linux - Hardware 2 06-29-2004 03:06 AM
C Function Arguments jpbarto Programming 6 04-23-2004 02:59 PM


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