Last active
September 11, 2018 03:26
-
-
Save iketiunn/f5a8d436c5546ee9f2f76dd18b9c4512 to your computer and use it in GitHub Desktop.
bash-snippet / bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Redireact stdout to date-named file | |
λ echo '123' >> "$(date -d 'yesterday 01:00' '+%Y-%m-%d').log" | |
λ ls | |
2018-09-10.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Kill with ps & pid | |
λ ps -eaf | grep [w]get | |
saml 1713 1709 0 Dec10 pts/0 00:00:00 wget ... | |
λ kill 1713 | |
# 2. pgrep | |
λ pgrep wget | |
1234 | |
λ kill 1234 | |
# 3. pkill || killall | |
λ pkill wget | |
# 4. jobs | |
λ jobs | |
[1]+ Running sleep 100 & | |
λ kill %1 | |
[1]+ Terminated sleep 100 | |
# 5. fg | |
#Fake job, sleep. | |
λ sleep 100 & | |
[1] 4650 | |
#Get the job's number. | |
λ jobs | |
[1]+ Running sleep 100 & | |
#Bring job #1 back to the foreground, and then use Ctrl+C. | |
λ fg 1 | |
sleep 100 | |
^C | |
λ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment