1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Linux command exercise - help a total noob?

  1. Jan 18, 2010 #1
    Firstly, I've literally never used a Linux machine in my life. My phys prof thought it would be a good idea to get us acquainted with the system, but didn't want to actually teach it...

    The following is an exercise in Linux. I'm having a lot of trouble finding the commands to accomplish this.

    1. The problem statement, all variables and given/known data

    1. Enter the command to print out the date in coordinated universal time (UTC). (Hint: Use a
    variant of the man command to help you find the appropriate command.) Now, enter the
    same command again, but this time redirect (append) the output to a file called Assign2.txt
    by following the command with the expression “>> Assign2.txt” (without quotation
    marks).

    2. Create a directory called Phy258Ass2 in your home area.

    3. Move the file Assign2.txt into the new directory you just created.

    4. Change to the new directory Phy258Ass2, i.e., make it your current directory.

    5. To confirm that this worked, enter the command to print your current (working) directory.
    Re-enter the command, this time redirecting (appending) the output to the file Assign2.txt.

    6. Enter the id command to print your user and group IDs. Again, redirect the output to the
    Assign2.txt file.

    7. The id command has an option that gives you the version of the id program and its authors. Find this option and use it, again redirecting the output to the Assign2.txt file.

    8. Find the command that reports file system disk space usage. Use the command and also
    redirect its output to the Assign2.txt file.

    9. Choose one of the text editors available on the Linux computer to insert the text “Phys 258, Assignment 2”, your name, your ID number, and your lab section at the
    top of the file Assign2.txt. Follow this with a line stating the name of the Linux text editor
    that you used. Take care not to disturb or alter the text data that you already have in this
    file. Exit from the text editor, making sure that your changes get saved.

    10. View the file you have just finished creating by using either the more or less command.

    11. From a different computer with printing capability, use secure ftp (sftp) to retrieve a copy
    of your Assign2.txt file on the applicable undergraduate physics Linux computer. (Note
    that the PuTTY package comes with an sftp utility.)

    3. The attempt at a solution

    Here is my attempt at googling the corresponding commands:

    1. date -u
    2. mkdir Phys258Ass2
    3. mv Assign2.txt Phys258Ass2
    4. cd Phys258Ass2
    5. ls -f
    6. id -u
    7.
    8. df
    9.
    10.
    11.

    :S
     
    Last edited: Jan 18, 2010
  2. jcsd
  3. Jan 18, 2010 #2
    hints:
    7. <program> --help or <program> -h will often give you a list of commands you can use with a program
    9. Google for linux text editors, then pick one. There's a wiki article on this.
    11. putty - this is just sorting out how to use a program, and putty documentation tends to be good.

    more shell tips
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Linux command exercise - help a total noob?
  1. Linux wc command (Replies: 1)

  2. Linux listing (Replies: 7)

  3. Matlab exercises (Replies: 1)

  4. Linux question (Replies: 1)

Loading...