Active Topics

 


Reply
Thread Tools
Posts: 19 | Thanked: 2 times | Joined on Jan 2008
#1
Hi, I'm just starting to learn *nix systems in general. I find myself switching to root a lot, and would like to create a shortcut on the X Terminal toolbar. I created on called Gainroot and enter "sudo gainroot" as the command but that doesn't do anything. Can I not run commands like that? If not, what is it's purpose?

Thanks,
Mike
 
Posts: 5,795 | Thanked: 3,151 times | Joined on Feb 2007 @ Agoura Hills Calif
#2
It works for <ctrl>p to go back in command history.

Perhaps someone will tell us the syntax for other commands.
 
Posts: 4,030 | Thanked: 1,633 times | Joined on Jul 2007 @ nd usa
#3
Would it be easier just to use the 'up' Dpad? Ctrl+p involves 4 key strokes - ctrl, command line, p, 'OK'.


bun
 
free's Avatar
Posts: 739 | Thanked: 159 times | Joined on Sep 2007 @ Germany - Munich
#4
alias r='sudo gainroot'
put this in .profile
then to become root, type

r

You could also create an x resource to map it to hardware key although I didn't try
 
tobiasj's Avatar
Posts: 241 | Thanked: 74 times | Joined on Jul 2007
#5
what would also be nice is something along the lines of the "root terminal" menu item in desktop linux.

I can certainly understand why there isnt one from the get go, being well dangerous to the system and all. But certainly we should be able to add one somehow. I am going to start poking around and see what I can come up with. never occured to me before now, but that would very nice.

-John
 
Posts: 86 | Thanked: 22 times | Joined on Jan 2008 @ Moscow
#6
Originally Posted by free View Post
put this in .profile
then to become root, type

r

You could also create an x resource to map it to hardware key although I didn't try
Where to search for this file? I haven't found it in home and root directories. Or should it be created?
 
Posts: 10 | Thanked: 1 time | Joined on Jan 2008 @ Treviso, Italia
#7
use this command:
Code:
sh -c "sudo gainroot"
 
Posts: 19 | Thanked: 2 times | Joined on Jan 2008
#8
Thanks for the replies everyone. micampe, I entered what you suggested as the value of the xTerm toolbar shortcut, but nothing happens when I click it. These shortcuts should be able to run terminal commands like that, right? I would definitely make one to fire up Hamachi if that were the case. Any ideas?

Thanks again,
Mike
 
Posts: 19 | Thanked: 2 times | Joined on Jan 2008
#9
BTW, I was playing around with your suggestion, and if I entered "sh 1" or "sh -c 1", then 1 will be sent to the terminal. However, "sh 12" and "sh -c 12" don't send 12 to the terminal. Also, "sh "1"" and "sh -c "1"", with quotes around the 1, doesn't even send 1, like it will without the quotes.

Thanks,
Mike
 
free's Avatar
Posts: 739 | Thanked: 159 times | Joined on Sep 2007 @ Germany - Munich
#10
Originally Posted by sashabe View Post
Where to search for this file? I haven't found it in home and root directories. Or should it be created?
create it yes

$HOME/.profile is executed on login shells
/home/user/.profile
 
Reply


 
Forum Jump


All times are GMT. The time now is 22:45.