Sunday, January 6, 2013

How to move up and down in a linux command line terminal?

Q. Umm, I've seen plenty of documentation on all the commands in Linux, but I haven't seen how to perform the most simplest thing like moving up and down through the terminal to view what commands you've done and what help files you've displayed. Just the keyboard replacement for using the scrollwheel would be great. Thanks.

A. You can use page up and page down. If in a shell without a scroll bar or at one of the non-graphic shells, then alt-page up alt-page down works, sometimes it is shift, it just depends on what your keyboard mappings are and what flavour of distro you are running.

If you want to see a history of your commands, then type history

If you want to execute one of your historical commands you could do something like:

> history

1 blah blah blah
2 blah blah blah
3....

To execute it just type
!2
Hit enter and bam, you just executed what ever was in your history at line 2.

In your bashrc or what ever other shell you are using, you can set up the length of your history - I think it defaults to about a thousand lines.

How do I run a web browser from linux command line?
Q. I an VERY new to linux. I have installed Fedora 5 in text mode. I have a Linux book and am trying to slowly learn linux. So from the console, or command line, how do I run a web browser. Also how do I run the X Windows System?

A. If you installed in text mode, maybe you didn't install X. You probably have a text mode browser. Try lynx or elinks. If the startx command doesn't work, try "yum install x-window-system". By the way, Fedora 5 is old. The current version of Fedora is 9.

What is the linux command to obtain the PID number of a specific program running?
Q. I'm tired to use the "top" and search around for the PID of a program that I know is running on a remote terminal, left open by someone else, and that I want to kill. I wonder if there is a linux command that would return the PID of only that program.

A. ps aux | grep processname
or
pidof processname




Powered by Yahoo! Answers

No comments:

Post a Comment