Page 4 of 4 FirstFirst 1234
Results 46 to 58 of 58
  1. #46
    Joined
    Jul 2001
    Location
    UK
    Age
    51
    Posts
    20,229

    Re: Cool command line stuff

    Quote Originally Posted by s0urce View Post
    In my experience -- yes -- the HW and Sys clocks run independantly. I've seen several circumstances where I'll change the system time, reboot the system, and come back with the HW clock time.
    Also, some distro's (such as mine ) now automatically sync the hardware clock to the software clock on shutdown, on the assumption that the software clock is correct as it's being sync'd with a time server. That way you never need to worry about it ever again.

    I noticed it flash up a message on the screen during the shutdown procedure... something like syncing hardware clock.

  2. #47
    Joined
    May 2000
    Location
    /home/christop54
    Age
    48
    Posts
    4,430

    Re: Cool command line stuff

    Quote Originally Posted by Spankin Partier View Post

    To stop an application you'll have to do one of a couple things (depending on the terminal you're using). Either try [Crtl]+Z or [Crtl]+[Pause]. That'll stop the current application.
    Quote Originally Posted by s0urce View Post
    CTRL + C is definitely a handy one to have. Kills the foreground process.
    Here are a few more Ctrl+ type commands (and a Shift+ command thrown in for good measure):
    • Ctrl+ A: Move cursor to the beginning of command line.
      Ctrl+ D: Logout/exit shell.
      Ctrl+ E: Move cursor to the end command line.
      Ctrl+ H: Generate backspace character. (Same as hitting Backspace key.)
      Ctrl+ L: Clear terminal.
      Ctrl+ R: Search command history.
      Shift+ PageUp/PageDown: Browse terminal buffer. (Just tried using this one; it doesn't seem to do anything.)

  3. #48
    Joined
    Aug 2001
    Location
    Auckland, NZ
    Posts
    5,349

    Re: Cool command line stuff

    Ok....someone HAS to explain to me why there is a 2-key combination (Ctrl+H) that would normally require 2 hands to type......that allows you to issue a single key

    Does it appear as the sequence until a script is run at which point it executes a backspace....or just something that serves little purpose?

    Quote Originally Posted by Christop54 View Post
    Here are a few more Ctrl+ type commands (and a Shift+ command thrown in for good measure):
    • Ctrl+ A: Move cursor to the beginning of command line.
      Ctrl+ D: Logout/exit shell.
      Ctrl+ E: Move cursor to the end command line.
      Ctrl+ H: Generate backspace character. (Same as hitting Backspace key.)
      Ctrl+ L: Clear terminal.
      Ctrl+ R: Search command history.
      Shift+ PageUp/PageDown: Browse terminal buffer. (Just tried using this one; it doesn't seem to do anything.)
    Last edited by Hubris; 02-06-2007 at 08:56 AM.

  4. #49
    Joined
    Jul 2001
    Location
    UK
    Age
    51
    Posts
    20,229

    Re: Cool command line stuff

    Quote Originally Posted by Christop54 View Post
    Here are a few more Ctrl+ type commands (and a Shift+ command thrown in for good measure):
    • Ctrl+ A: Move cursor to the beginning of command line.
      Ctrl+ D: Logout/exit shell.
      Ctrl+ E: Move cursor to the end command line.
      Ctrl+ H: Generate backspace character. (Same as hitting Backspace key.)
      Ctrl+ L: Clear terminal.
      Ctrl+ R: Search command history.
      Shift+ PageUp/PageDown: Browse terminal buffer. (Just tried using this one; it doesn't seem to do anything.)
    Wow - didn't know most of those

  5. #50
    Joined
    Oct 2001
    Location
    Southern Ontario
    Age
    45
    Posts
    13,194

    Re: Cool command line stuff

    Quote Originally Posted by Hubris View Post
    Ok....someone HAS to explain to me why there is a 2-key combination (Ctrl+H) that would normally require 2 hands to type......that allows you to issue a single key
    The Ctrl+Z and many others stems from the days when people would remotely log in to a *nix system from dummy terminals. These terminals had all different keyboard layouts. Some would have more keys then others. Not all keyboards have a [Pause] key. So to get around this they use allow you to use Ctrl+Z instead.

  6. #51
    Joined
    Aug 2001
    Location
    Auckland, NZ
    Posts
    5,349

    Re: Cool command line stuff

    I've worked at a number of different varieties of dumb term, and have yet to see one that didn't have a backspace. Some didn't have delete...

    Point taken...it was there in case it was needed.

  7. #52
    Joined
    Oct 2001
    Location
    Southern Ontario
    Age
    45
    Posts
    13,194

    Re: Cool command line stuff

    Yeah, it would be odd if there wasn't a backspace button. Who knows, maybe there were some that sent non standard characters back. Sorta like the Enter button. Some terminals send only an ASCII chr 13 and some send ASCII chr 13 & 12. In effect treating the Enter button as two different key strokes.

  8. #53
    Joined
    Mar 2002
    Posts
    356

    Re: Cool command line stuff

    remember most of the control keys are shell specific. Also "stty -a" is your friend. You can change delete to ^H and such. Then again xmodmap allows you to remap your keyboard to change the code generated by the 'delete ' key. If you are worried about ^D just add this to .bashrc (presuming you use bash) "stty eof undef"

  9. #54
    Joined
    Oct 2001
    Location
    Southern Ontario
    Age
    45
    Posts
    13,194

    Re: Cool command line stuff

    One neat trick I like to do to my computers since I'm running Bash shell is to edit the .bash_profile found in your home directory.

    I've customized mine on my little home webserver to display system status every time I log in. This is really useful since I'm running Linux RAID 1. This tells me if everything is still alright. Here's my .bash_profile:

    Code:
    alias ls="ls --color=auto"
    uptime
    echo
    free -k
    echo
    df -h
    echo
    cat /proc/mdstat
    The first line sets up ls to work the way I like it. The last line allows me to see how my RAID is doing. The others just shows me other system stats.

    You can use the .bash_profile file to run anything you'd like each time you start up a new shell. The sky's the limit!

  10. #55
    Joined
    Jul 2001
    Location
    UK
    Age
    51
    Posts
    20,229

    Re: Cool command line stuff

    ...and here's some more cool stuff you can do in .bashrc

    If you're lazy, like me, and can't remember or don't want to type commonly used commands, you can set aliases. So, say you commonly use tar to extract tar archives (or tar.gz, tar.bz), you could add the following:

    Code:
    tarx () { tar xvf $1 }
    targz () { tar xvzf $1 }
    tarbz () { tar xvjf $1 }
    Then, to extract, all you need to type is:

    Code:
    tarx file.tar
    targz file.tar.gz
    tarbz file.tar.bz2
    Of course you could equally use a simple script in /bin, but aliases are nice for individual users. Also, virtually any command can be aliased similar to the examples above, including pipes, conditionals and loops.

    Here's another one I use to unzip all files in the current directory:

    Code:
    unzipall () { for i in *.zip; do unzip $i; done }
    and one to rename all files to their md5 checksum:

    Code:
    md5ren () { for i in *; do md5sum $i | awk '{ if (NF == 2) print $2, $1; else print "\"" $2, $3 "\"", $1}' | xargs mv; done }
    ^^ no way I'm typing that every time!

  11. #56
    Joined
    Jun 2003
    Location
    USA
    Posts
    44

    Re: Cool command line stuff

    I didn't see it mentioned anywhere, but of my most used ( and taught) Unix shortcuts is to use the "~" to indicate my home directory.

    I have alias out the wahzoo cause I'm so lazy , and whenever I have to move or copy or unzip something at work i try to use as few words as possible (mainly because I'm a terrible typer), below is a sample of what I'm talking about:

    UNIX> gzcat thisfile.z > ~/rpts/thesefiles
    In a museum in Havana, there are two skulls of Christopher Columbus, "one when he was a boy and one when he was a man." -- Sam Clemens { Mark Twain }

  12. #57
    Joined
    Jul 2001
    Location
    UK
    Age
    51
    Posts
    20,229

    Re: Cool command line stuff

    Shock, horror - but here's a nice little tit bit for command line users running Windows.

    Check out PowerShell for Windows:

    http://www.microsoft.com/windowsserv...l/default.mspx

    Jimz also just posted a very nice Video from SANS introducing PowerShell:

    http://forums.pcper.com/showthread.p...&postcount=696

    It's a UNIX like shell for Windows with loads more administration type commands built in and seems to be the way Microsoft is moving for system administration. So now us command line junkies needn't feel frustrated when we still need to use Windows

    ^^ Spanky is gonna love this!!!

  13. #58
    Joined
    Aug 2001
    Posts
    74,682

    Re: Cool command line stuff

    Credit goes to Gator. I just remember thread topics and it clicks in my head to save stuff.

    Here is Gator's thread.

    http://forums.pcper.com/showthread.p...74#post4120574

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •