0% found this document useful (0 votes)
8 views

Solution LinuxCommands ThursdayLab

Linux Commands

Uploaded by

anacisil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Solution LinuxCommands ThursdayLab

Linux Commands

Uploaded by

anacisil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Solution Document

1. Create a folder called homework:


Use the mkdir command to create a new directory:

mkdir homework

2. Copy the hello_world.c program into your homework folder:


Use the cp command to copy the file into the homework directory:

cp hello_world.c homework/

Ensure that you are in the directory where hello_world.c is located, or provide the full path
to the file.

3. Create a directory called hints:


Use the mkdir command to create a new directory:

mkdir hints

4. Create a new file called hints.txt inside the hints directory. Type in the
name of 4 Linux commands inside this file:
Navigate to the hints directory:

cd hints

Use the nano editor to create and edit hints.txt:

nano hints.txt

Inside the nano editor, type the names of 4 Linux commands (e.g., ls, pwd, mkdir, cd), then
save the file by pressing Ctrl + O, and exit the editor with Ctrl + X.

5. Create a file called junk.txt:


Use the touch command to create an empty file named junk.txt:

touch junk.txt
6. Delete the file called junk.txt:
Use the rm command to remove the file:

rm junk.txt

7. Look up the man page for a command and try an option we didn’t
discuss in class:
Use the man command to look up the manual page for a specific command. For example, to
learn more about the ls command, type:

man ls

Scroll through the options and try one that wasn’t covered in class, such as ls -R (which lists
subdirectories recursively). You can try it with:

ls -R

You might also like