Using Linux
Updated January 30, 2003
Created January 14, 2003


Autogenerated Site Map
Search this Site!:
Search this site powered by FreeFind

Common Usage Shortcuts

Bringing back a previous command you typed.
  • Up and Down arrow keys
  • CTRL+r to search backwards

  • Clearing a line from cursor position back to the far left
  • CTRL+u will delete from cursor position back to the far left. This method works at command prompts, password prompts, and even works when keying in a URL into the address bar of web browsers, and more. I use CTRL+u most often for password prompts, when I know that I've messed up the password, but I'm not sure how many backspaces I need to erase off the password -- Instead of taking a failure and trying again, I just erase cleanly with CTRL+u and then rekey the password.

  • Filename Completion (TAB)
  • Use the [TAB] key to complete filenames and directory paths. Tab once to complete, if you get a beep, then tab a 2nd time to see a listing of valid choices to choose from OR if you know what you are typing then just type a couple of more characters. Then hit [TAB] again to complete again. [TAB] will stop each time that it cannot properly determine which filename you are trying to complete. Typing [TAB] twice will bring up a list of possible choices.

  • Switching to different consoles
  • Press ALT+Fn to switch away from a text console
  • Press CTRL+ALT+Fn to switch away from a graphics console

  • Note: Left_ALT + F1 thru F6 is generally reserved for text consoles. Left_ALT + F7 thru F12 is generally reserved for graphical consoles. To start a 2nd graphical console, just run startx -- :1 &



    Use the following search methods to "Find files containing searchtext":
    (case insensitive)
    find . -type f -exec grep -Hi searchtext \{\} \;
    (case sensitive)
    find . -type f -exec grep -H searchtext \{\} \;

    find . -type f | xargs -n 1 grep -H searchtext

    Displaying a File
    "cat" will show the contents of a file.
    cat filename

    Pagers
    Use "less" and "more" when content scrolls off the screen.
    less filename
    more filename

    Pipes and Redirects
    A pipe "|" symbol causes the Standard Output of the first program
    to be fed into the standard input of the next program. For example, the above
    could be written:
    cat filename | less
    cat filename | more

    stdin, stdout, and stderr
    These are Standard Input, Standard Output, and Standard Error.
    &0 represents Standard Input and is usually attached to the keyboard
    &1 represents Standard Output and is usually attached to the monitor
    &2 represents Standard Error and is usually attached to the monitor

    More on Pipes and Redirects
    The pipe symbol "|" can catch the standard output and pass it
    as input to the next program down the "pipeline".
    cat filename (this displays on the screen and scrolls off the screen because the contents of filename is so long)
    cat filename | less The pipe symbol catches the output from "cat filename" and passes it as input to the program "less". "less" then displays it on the screen.
    The pipe symbol will not catch standard error. To make the pipe symbol catch standard error,
    you must "redirect" standard error to standard output as follows:
    myprog 2>&1 | less

    Do not use unsecure tools like ftp and telnet. Whatever you do, never send your password through ftp nor telnet. Please do use secure tools such as ssh for logins and file transfers. SSH never sends your password over the network, where telnet and ftp sends your password over the network in plain text. Just about any "network sniffer" is able to catch the password and even redisplay your whole screen you see through telnet.

    Users, Groups, and passwords
    useradd, groupadd, passwd

    chmod

    chown (and chgrp)

    ls

    cd

    pwd



    ls
    cd
    pwd
    mkdir
    rmdir
    touch (creating a blank file)
    rm
    Jobs and Job Control
    Background, forground, nohup, &, ...


    Everything (Text and Graphics) in Unix/Linux is capable of being run remotely.
    For text programs, all you need to work with it remotely is to log in through ssh (or rsh or telnet). After you login using one of these methods you then start your program on the remote system and use it.

    For remote graphics programs you have many options as well.
    Log into remote server (using ssh, telnet, or rsh), set the DISPLAY variable to point to your workstation, then start the graphics program. (graphics will not be secure - ssh user@dest)
    Log into remote server and have ssh set up the DISPLAY variable for you (graphics will be secure ssh -X user@dest)
    Use XDMCP to access a remote desktop
    Use VNC to access a remote desktop. Also note that VNC is stateless -- meaning that you can disconnect from VNC, then reconnect at a later time and pick up exactly where you left off.
    You may also install X-Windows on a MS Windows system through one of many programs (exceed's humminbgird, MI/X, and others), namely cygwin is one of the better (and free) ones that use the same source code that their linux counterparts are using. So cygwin provides you with ssh, X11, ls, cd, grep, sed, awk, ...

    Search this Site!:
    Search this site powered by FreeFind

    Homepage: http://www.cpqlinux.com
    Site Map: http://www.cpqlinux.com/sitemap.html