Results 1 to 6 of 6

Thread: Terminal-ness

  1. #1
    Join Date
    Feb 2013
    Beans
    33

    Terminal-ness

    Soooooo, I really enjoy using terminal, but I feel I haven't learned everything there is to know about it. I know a lot of the basic stuff (ping, sudo apt-get install/update/upgrade , cd, ls, pwd, cowsay, etc) are there any other commands i should know to be fluent with in terminal? Also, is there something like Batch files but for terminal?

  2. #2
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    13,614
    Distro
    Ubuntu

    Re: Terminal-ness

    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful
    .

  3. #3
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    redirects and pipes

    The link mentioned above goes to some good resources. I would highly recommend figuring redirects and pipes into your self-study curriculum. They really bring the power of the shell to the forefront even if you can only recall a few programs off the top of your head. sed and awk are useful, too.

  4. #4
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Terminal-ness

    If you want a print book to look at, here is a review of one that would be relevant:

    http://books.slashdot.org/story/13/0...ll-programming

  5. #5
    Join Date
    Mar 2012
    Location
    Near one of my computers
    Beans
    307
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Terminal-ness

    One thing I find very useful is tab completion. When typing into a terminal it's important to be accurate. When typing for example a file name start with the path and then press tab to complete the path. For example
    Code:
    $ ls Doc <TAB>
          #changes to 
    $ ls Documents/
          #or 
    $ ls D <TAB>
          #nothing happens
         <TAB> #again lists possible completions
    $ ls D <TAB> <TAB>
          Documents/ Downloads/ Desktop/
    Using this , it improves your accuracy as you move from directory to directory helping to avoid typos. It can also help speed up changing directories or typing out long file paths. It also automatically escapes characters like '?,!' and whitespace, " " in filenames.

    Code:
    $ ls
    backlight  hdmi  openbox-pypanel.sh  update-git  document 1
    # the contents of a directory
    
    #the cat command can output the contents of a file.
    #pretend you want to `cat' document 1
    
    $ cat document 1
    cat: document: No such file or directory
    cat: 1: No such file or directory
    
    # cat sees those as two files, so you have to tell it that its all one filename by escaping the space with the "\" character
    
    $ cat document\ 1
     contents of document 1
    
    #or 
    
    $ cat doc <TAB>
    
    #changes to 
    
    $ cat document\ 1
    contents of document 1
    Like stated above, read the sticky post about it.

    Scripting is also nice to be able to do, it can help speed up more complicated processes that you do often. And it's fun!

    Best of luck
    Kopkins
    Last edited by Kopkins; March 25th, 2013 at 08:19 PM.

  6. #6
    Join Date
    Mar 2013
    Beans
    8

    Re: Terminal-ness

    The ubuntu/linux version of a windows batch file is a .sh (shell) script.

    To run an sh file: [(sudo)] sh (filename).sh

    For example:

    sudo sh myscript.sh

Bookmarks

Posting Permissions

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