Little Known Linux commands - Page 2
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22

Thread: Little Known Linux commands

  1. #11
    Senior Member
    Join Date
    Jan 2005
    Posts
    128
    oh, whilst were adding scripts that do our job for us...

    apt-get update <- put that in your cron.daily directory ... The amount of times ive forgotten to run that file installed a program only to realise there is an update ....

    lsof is also good for listing open files (this includes devices etc very useful for programs hogging a device)

    lsof | grep /dev/dsp

    I have to close some programs via that method because they lock my DSP
    http://sfx-images.mozilla.org/affili...88x31/take.gif
    If You\'ve Done Something Right. People Wont Know You\'ve Done Anything At All - God (futurama)

  2. #12
    Senior Member
    Join Date
    Sep 2003
    Posts
    500
    *su - root - If you just type su, not everything is exported, i.e. shell aliases and ls colors
    You shall no longer take things at second or third hand,
    nor look through the eyes of the dead...You shall listen to all
    sides and filter them for your self.
    -Walt Whitman-

  3. #13
    Senior Member
    Join Date
    Feb 2005
    Posts
    153
    Here's a way to use already existing command features that I've discovered some are not aware of:

    Doing just a cd without syntax behind it will automagically redirect you back to the home directory of whatever user you happen to be logged in as.

    test@/etc/dvd/> cd

    Logged in as test will bring you back to /home/test

    Logged in as test and under su root, will bring you back to /root
    \"It is not the strongest of the species that survive, nor the most intelligent, but the one most responsive to change.\"
    - Charles Darwin

  4. #14
    Senior Member
    Join Date
    Jun 2002
    Posts
    394
    Originally posted here by Lansing_Banda
    *su - root - If you just type su, not everything is exported, i.e. shell aliases and ls colors
    or just,

    [code]su -[code]

    Hmm...theres something a little peculiar here. Oh i see what it is! the sentence is talking about itself! do you see that? what do you mean? sentences can\'t talk! No, but they REFER to things, and this one refers directly-unambigeously-unmistakably-to the very sentence which it is!

  5. #15
    Senior Member
    Join Date
    Dec 2004
    Posts
    107
    the most annoying part about su is that it doesn't even export the PATH.

    Anyway, since I like this thread so much, here's my contribution (to tack onto Guardian Alpha, if I may):

    Code:
    cd -
    will get you back to your previous working directory

    example:
    Code:
    [root@me /]cd /usr/bin
    [root@me bin]# cd /etc
    [root@me etc]# cd -
    /usr/bin
    [root@me bin]#
    it's a real time saver.

    ik
    Alright Brain, you don\'t like me, and I don\'t like you. But let\'s just do this, and I can get back to killing you with beer.
    -- Homer S.

  6. #16
    Senior Member
    Join Date
    Sep 2001
    Posts
    1,027
    a few time savers:
    pgrep
    pkill
    zcat
    zmore
    zgrep

    also, someone mentionned lsof, which has fstat for equivalent in bsd...


    Ammo
    Credit travels up, blame travels down -- The Boss

  7. #17
    Junior Member
    Join Date
    Apr 2005
    Posts
    1
    Something that I find very useful is the screen command.

    It comes in handy when you want to SSH back to the same session on a box. For example if you're running some kind of client eg an IRC client, usually when you close the SSH session you won't be able to go back to your IRC screen. The program screen solves this. Here's an example:
    Code:
    screen -t irc Bitchx
    Now you're running Bitchx on a new terminal. To get back to your original terminal you press ^ad (Control+A, then D). The D stands for Detach.
    You can now close your SSH session while the Bitchx client still runs. When you SSH in again, run the command
    Code:
    screen -r
    And voila you're looking at the same Bitchx client you left running before.

  8. #18
    Junior Member
    Join Date
    Apr 2005
    Posts
    4
    Backgrounding ssh port forwarders, ability to use same terminal setting up multiple forwarders. This way you don't accidently close your term and thus killing your forwarder.

    ssh -f -N -L 8080:123.123.123.123:80 username@hostname.com

  9. #19
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,403
    Just to get back on my own post Why use tar instead of move or copy?

    mv/cp screws up symlinks, tar doesn't. That's the reason I had problems
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  10. #20
    Junior Member
    Join Date
    Apr 2005
    Posts
    4

    Cool

    I would still have to tend to either use scp or rsync w/ ssh encryption when copying files/dirs between hosts. But again its all more of a personnal opinion. Theres 50 different ways of doing it on unix

Posting Permissions

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