1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Linux / Unix commands tips....

Discussion in 'Unix' started by vishal sharma, Jul 27, 2004.

  1. vishal sharma

    vishal sharma New Member

    Joined:
    Jul 23, 2004
    Messages:
    106
    Likes Received:
    6
    Trophy Points:
    0
    I have been using linux for 2 years now, and I can tell you that I learn something new virtually every day. And a few of those things I have learned are very rare to be seen all the time. Here are a few of them.

    If you are using Redhat's netcfg utility to connect to the internet and you are sick of having to open up the GUI, and click on ACTIVATE to connect, and then have to click on DEACTIVATE to disconnect... here is one little thing that you can do to make life easier.

    Let's say you have a ppp0 set up with netcfg. Just add this two lines to your /etc/bashrc

    alias dial="/etc/sysconfig/network-scripts/ifup-ppp /etc/sysconfig/network-scripts/ifcfg-ppp0"

    alias hangup="/etc/sysconfig/network-scripts/ifdown-ppp /etc/sysconfig/network-scripts/ifcfg-ppp0"

    Now if you want to connect, all you need to do is to go to your terminal and type dial; if you would like to disconnect just type hangup.

    Here is another cool thing for you guys that use bash.

    Let's say you want to create a new directory called test

    And you type:

    # mkdir

    Note that the command is mkdir, not mkdri. Instead of backspacing to fix this typo, go ahead and hit Ctrl+t (simultaneously). It will swap the two letter and you have your command fixed.

    Also for you guys that are using bash.
    Don't you hate when you want to go from one directory to another, but the directory is a 200-letter name? Let's say you wanted to go from your current directory to the directory what_is_wrong_with_this_directory.

    # cd what
    Now, go ahead and hit the TAB key. This will make the shell look through your paths and find the possibilities that starts with what.

    Note: If you hit tab once and nothing happens, hit it twice, because if there is any other directory that starts with the word what then the shell would not know to what directory to go to.

    Customizing your directory colors.

    I know a lot of you know the command ls --color. Which displays your directory with colors. But, a lot of people may not know that those colors are customizable. All you need to do is add the following line to your /etc/bashrc file.

    eval `dircolors /etc/DIR_COLORS`
    And then all of the color configuration can be found in the file /etc/DIR_COLORS

    Frozen Xwindow.
    If your Xwindow freezes sometimes, here are two ways that you may try to kill your server. The first is the simple simple way of killing your X server the key combination: Ctrl+Alt+Backspace

    The second way is a little more complicated, but it works most of the time. Hit Ctrl+Alt+F2 to startup a virtual console, then log in with your user name and password and run:

    # ps -ax | grep startx

    This will give you the PID of your Xserver. Then just kill it with:

    # kill -9 PID_Number

    To go back to your first console, just hit Alt-F1
     
  2. kunwar_salim

    kunwar_salim New Member

    Joined:
    Jan 14, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    hi its kunwar saleem
     
  3. kunwar_salim

    kunwar_salim New Member

    Joined:
    Jan 14, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    hi its kunwar saleem
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,285
    Likes Received:
    364
    Trophy Points:
    83
    Welcome to the forum and we have a section for introducing yourself and its better if you dont do this as a comment to the articles and keep the comments relative to the articles.
     
  5. clocking

    clocking New Member

    Joined:
    Jun 12, 2007
    Messages:
    122
    Likes Received:
    0
    Trophy Points:
    0
    oh, Using C program with file .dll in Linux OS. How many library in Linux OS?
     
  6. micman

    micman New Member

    Joined:
    Jan 25, 2008
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    0
    Excellent !
     
  7. kunjire

    kunjire New Member

    Joined:
    May 23, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Thanx buddy
     
  8. mma007

    mma007 New Member

    Joined:
    Jun 27, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    nice useful Linux / Unix commands tips.
     

Share This Page