List Of Commands
1. cat - command in unix shows you the content in the file.
2. >> - Using two right facing angular brackets in command you can output the content of command on the left( left to brackets) to right(of brackets).
3. echo - command writes the evaluation of the right part(right of echo) to console.
4. whoami - command shows you the current user on linux/unix cli.
5. $(any) - Dollar and brackets covering any command, will evaluate the command and assign or print to console/variable as necessary.
Answers:
1. echo "username: "$(whoami) >> ~/workspace/project-log/changelog.txt
Above command will append the content of echo "username: "$(whoami) to File ~/workspace/project-log/changelog.txt
echo "username: "$(whoami) - concatenates username: and output of whoami command and prints onto std output.
>> ~/workspace/project-log/changelog.txt - copies the echo content from above to end of file changelog.txt
2. cat ~/workspace/project-log/file-list.txt >> ~/workspace/project-log/changelog.txt
Above command reads(using cat) the content of file file-list.txt and appends it to ~/workspace/project-log/changelog.txt using >>.
Any help would be appreciated. Reading file content in the CLI Collapse 3. 2. Challenge Content...
file content in the CLI Challenge Content concatenation Evaluate your content concatenation skills by completing the following tasks: workspace/project- 1. Append the current user to the log/changelog.txt file: Changelog: Version: 1.0 username: current_user 2. Append the workspace/project-log/file-list.txt file content to the --/Workspace/project-log/changelog.txt file: Changelog Version: 1.0 username: current_user hello.txt hi.txt project-log TIP: Use the tab autocompletion shartout
3. 2. Challenge Content concatenation Evaluate your content concatenation skills by completing the following tasks: Append the current user to the ~/workspace/project-log/changelog.txt file: Changelog: Version: 1.0 username: current_user Append the ~/workspace/project-log/file-list.txt file content to the ~/workspace/project-log/changelog.txt file: Changelog Version: 1.0 username: current_user hello.txt hi.txt project-log TIP: Use the tab autocompletion shortcut Once you have completed these tasks press the Check It button to have your solution assessed. Check It!