Results 1 to 4 of 4

Thread: *nix Commands: 102 - Addenum

  1. #1
    Just a Virtualized Geek MrLinus's Avatar
    Join Date
    Sep 2001
    Location
    Redondo Beach, CA
    Posts
    7,323

    Post *nix Commands: 102 - Addenum

    I get the feeling I'm gonna add these addenums all the time to these *nix commands tutorials. Some more commands that are helpful with files:

    pg filename: see a file one screenful at a time. Can also use: more filename. Difference between the two is that more shows you what percentage you have gone through in the document thus far.

    cat filename: show all the contents of a file. Remember, you NEVER cat a directory as you will get garbage. You can paginate this command by piping it to a more command e.g., cat filename | more.

    head -# filename: displays a certain number of lines from the top of a file. By default, without options, it shows the top 10 lines head filename. If you wanted to see the top 15 lines you'd type head -15 filename.

    tail -# filename: displays a certain number of lines from the bottom of a file. By default, without options, it shows the bottom 10 lines tail filename. If you wanted to see the bottom 23 lines you'd type head -23 filename.

    But what if you wanted to see line 14 and only line 14? Well that's where a friendly little critter called a pipe | comes in handy. A pipe is merely a filter. It takes the output of one command and makes it the input of another. So for this example I could do head -14 filename | tail -1.

    chown user:group: change the ownership of a file or directory.

    Out of these commands, the only one that has an equivant are the cat and more commands. cat is similar to the type command and more can be used in a fashion with a pipe and type e.g, type filename | more.
    Goodbye, Mittens (1992-2008). My pillow will be cold without your purring beside my head
    Extra! Extra! Get your FREE copy of Insight Newsletter||MsMittens' HomePage

  2. #2

    Smile

    thanks for the tutorial! very helpful.

  3. #3
    Senior Member
    Join Date
    Nov 2001
    Posts
    276

    Question

    interested in a UNIX bash tutorial?
    Dear Santa, I liked the mp3 player I got but next christmas I want a SA-7 surface to air missile

  4. #4
    Junior Member
    Join Date
    Dec 2001
    Posts
    2

    more command ???

    Perhaps you can had some other useful command...
    for example use < b > less < /b > instead of more so you can view the file in both direction ...
    to view some HOWTO nicely (when they appeared with line like ^H ...) do this : cat howtofilename | less
    so you can go down and up in the file ...
    I know more command but time is money like they say and I need to make some work for tommorow :{
    Bye.
    PS: sorry for the tags, I need to learn more about this site

Posting Permissions

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