PE day 1 Bash Flashcards
What is typed to clear your terminal?
clear…duh
What will give you a history of all the past commands you’ve typed in the shell?
history…also duh
what command copies files/directories?
cp (copy)
What shows your current working directory?
PWD (print working directory)
To stop a process from executing in shell what command can you run?
ctl + c
What keyboard command will do the same thing as hitting the up arrow?
ctl + p (as in previous)
What keyboard command will do the same thing as hitting the down arrow
ctl + n (for Next)
What command will allow you to simply escape out of a loop in progress?
break ( as in you need to break free)
What would you run to kill a process using a specific PID? (the command before the PID)
kill -9 (don’t know why, look it up, but i remember it by using a 9mm ;)
What is the alternate command for echo?
printf
If I wanted to display the PID of the last executed command, what variable would I echo?
myapp& echo
What command would show the last 5 lines of file1?
tail -5 file1
What command would show the first 5 lines of file1?
head -5 file1
If you wanted to find the process name from process id 8675, what command would you run?
ps -p 8675
To change a file so that it can be an executable what command do you run?
chmod 777
What command changes a directory?
cd (for change directory)
hat command can you use to remove a file?
rm (for remove, you would then specify the file either by relative, absolute path or by filtering…careful with your wildcards)
If you want to display the contents of file1, what command can you run?
Cat as in concCATenate….the commands “more” and “less” also work
What command will show what users are currently logged in?
Who…as in “who is logged in right now?”
What command will show you how long a system has been running?
runtime….makes sense