CL Extras Flashcards
What does the cal command do?
prints out a calendar
What would you type if you wanted to see the current year’s calendar?
cal -y
What would you do if you wanted to display the calendar of a different year?
cal 2015
How can you display the month of a year?
pass two integer parameters:
cal 8 2016 = august 2016
What command will print out the contents of a file to standard output?
cat
How can you send the output of cat to a file?
cat file1.txt file2.txt > new_file.txt
How can we print to the screen a file’s contents with line numbers added?
cat -b file.txt
What is the default signal for kill?
15 or SIGTERM
How can we find the process ID of the process that we need to stop?
ps command shows PID
What does this command do:
kill 123456
It sends a signal to process 123456 to peacefully shut down when it is ready.
What two ways can you pass a signal to the kill command?
with the value of the signal or by using the -s flag and passing the name of the signal.
kill -9 123456
kill -s SIGKILL 123456
What command prints out information about commands?
man
syntax: $ man command_you_want_to_learn_about
What command allows us to look at the end of a file?
Tail
What is the tail command good for?
monitoring log files in a production environment
By default, when you pass a file name to the tail command, the last __ lines of a file will be printed to the screen, and ___.
10
tail will exit.