Guest User

Untitled

a guest
Mar 17th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. 1.3: The command to print out hello with the newline is: echo -n hello
  2. I found this out by typing 'man echo', and searching through the command list.
  3.  
  4.  
  5. 1.4: Ctrl+A moves to the beginning of a line, Ctrl+E moves to the end of the line, and Ctrl+U clears the line and
  6. moves to the start.
  7.  
  8. 1.5: Ctrl+L clears the screen, Ctrl+D exits the terminal.
  9.  
  10. 2.1: The cat command can be used to view a file in your terminal and concatenate files. The diff command is used
  11. to view the difference between two files.
  12.  
  13. 2.2: To view all txt files you would use the command ls *.txt, to show all hidden files you would use the command
  14. ls -a.
  15.  
  16. 3.1: You can use the curl command to download files from the internet. For example 'curl -OL cdn.learnenough.com/sonnets.txt'.
  17. This is using curl to retrieve the file, with the option -OL meaning it will save the file with the same name as the source,
  18. and if the server indicates the file location has changed, curl will reattempt to fetch the file from the new location.
  19.  
  20. 3.3: Two commands you can use in conjunction with less are /<string> to find a string within a file, and 'G' to move to the end
  21. of a file.
  22.  
  23. 3.4: You can use grep to search for a substring in a file with grep <string> <file>. You could also use grep to filter through
  24. processes to find some you want. For example, 'ps aux | grep server' would give a list of server processes.
Add Comment
Please, Sign In to add comment