|
Answer» Hello,
I had ONE of my class substituted with my current class which focuses on command line.....I have zero clue about this type of stuff can ANYONE help with some lab QUESTIONS?
1.Navigate to the user account home directory. Use the command line to create a file named test.txt with the text “HI I AM A TEST FILE”. Output the contents of the file using a command line program to verify that the file contains what it should. I deleted the duplicate threads. Please only post once. Thanks.We aren't going to do your work for you by simply giving the exact commands to run. Instead I'll give you hints and let you work the rest out.
Break the instructions into chunks, each will map to one command:
Navigate to the user's home directory To change directory you should use the "cd" command, you can find the man page for it here: http://linuxcommand.org/lc3_man_pages/cdh.html I'll leave you to figure out how to get the home directory (hint, that page explains it if you read carefully enough)
Use the command line to create a file named test.txt with the text “HI I AM A TEST FILE” If you use the "echo" command such as: Code: [Select]echo “HI I AM A TEST FILE”You will see that it will print the message to the screen, this is known as stdout. You can then "redirect" the contents of stdout to a file which is explained here: http://www.cyberciti.biz/faq/bash-script-output
Output the contents of the file using a command line program to verify that the file contains what it should. For this you would use the "cat" command: http://linux.die.net/man/1/cat
I'd strongly recommend learning more about the command line as once you master it it can be a lot easier and faster to use than using a regular file browser. For example, if you want to batch rename a bunch of files or even search a bunch of text files for a word and store the names of the files that contain it in another file, you can do it with a single command rather than having to manually do it with the graphical interface or find a THIRD PARTY program to do what you need. Nowadays I don't even have a file browser installed on my system, I can do all file browsing/manipulation through the command line. Just force yourself to use it more and you'll soon figure it out.
|