Sunday, January 6, 2013

What is the linux command to list every file on the computer ?

Q. I know in DOS you do dir /s for the entire system. What is the linux equivalent ?

A. ls -Ra /

That is LiSt Recursively All files starting with / (the top level).

What is the linux command to log users off the system?
Q. ...If I am root? I know groupdel *user* completely deletes it but what if I just want to log them off? Or kill all of their processes.

A. pkill -U username

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.




Powered by Yahoo! Answers

No comments:

Post a Comment