Linux command exercise - help a total noob?

Click For Summary
The discussion revolves around a beginner's struggle with a Linux command exercise assigned in a physics course. Key tasks include printing the date in UTC, creating a directory, moving files, and using various commands to manage files and directories. The user has attempted some commands but seeks assistance with others, particularly finding options for commands and using a text editor. Hints provided suggest using the man command for help and exploring Linux text editors. Overall, the thread highlights the challenges faced by newcomers to Linux and the need for guidance in executing basic commands.
mathman44
Messages
204
Reaction score
0
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.

Homework Statement



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.)

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:
Physics news on Phys.org
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.

http://linuxcommand.org/learning_the_shell.php
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
21
Views
5K
Replies
16
Views
3K
  • · Replies 5 ·
Replies
5
Views
9K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
6K
  • · Replies 3 ·
Replies
3
Views
2K