| Command | Description | Example |
|---|---|---|
cat |
📄 Display entire log file | cat /var/log/syslog |
less |
📃 View log file with pagination | less /var/log/auth.log |
tail |
🔚 View end of log file | tail /var/log/apache2/access.log |
head |
🔝 View beginning of log file | head /var/log/mysql/error.log |
| Command | Description | Example |
|---|---|---|
parallel echo ::: A B C |
🔤 Process items in parallel | Output: A, B, C (in any order) |
parallel echo {} ::: *.txt |
🔍 Use {} as placeholder | Echoes names of all .txt files |
cat file.txt | parallel echo |
📥 Read input from stdin | Processes each line of file.txt |
parallel -j4 command ::: item1 item2 item3 |
🔢 Limit to 4 jobs at a time | Runs 'command' on items, max 4 parallel |
| Operator | Description | Example |
|---|---|---|
; |
📊 Run commands sequentially | echo "Hello"; echo "World" |
&& |
✅ Run next command only if previous succeeds | mkdir dir && cd dir |
|| |
❌ Run next command only if previous fails | ping -c1 google.com || echo "Offline" |
| |
🚿 Pipe output of one command to another | ls -l | grep ".txt" |
This file contains hidden or 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
| name: Mark stale pull requests in Shepherd repo | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 1' # Runs every Monday at midnight | |
| jobs: | |
| stale: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 |
This file contains hidden or 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
| <header class="header"> | |
| <a href="" class="logo">CSS Nav</a> | |
| <input class="menu-btn" type="checkbox" id="menu-btn" /> | |
| <label class="menu-icon" for="menu-btn"><span class="navicon"></span></label> | |
| <ul class="menu"> | |
| <li><a href="#work">Our Work</a></li> | |
| <li><a href="#about">About</a></li> | |
| <li><a href="#careers">Careers</a></li> | |
| <li><a href="#contact">Contact</a></li> | |
| </ul> |
This file contains hidden or 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
| def search_file(term, fname): | |
| with open(fname, "r") as filein: | |
| content = filein.read() | |
| if term in content: | |
| return True | |
| else: | |
| return False | |
| def term_check(): |
This file contains hidden or 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
| ((?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Sept|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?) \s\d\s\d{1,2}:\d{1,2}:\d{1,2}\s)(did\d+)\s(inbound\[\d+\]):\s(FAX/VOICE):\s(service=\w+),\s(to=\w+),\s(utime=\d+),\s(page_cnt=\d+),\s(mode=\w+:\d+),\s(contact_ip=\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}),\s(vchan=\d+),\s(session=\d+),\s(res=\d+),\s(bps=\d+),\s(dur=\d+),\s(size=\d+),\s(skey=\d+),\s(ckey=\d+),\s(csid=\w+|\d+),\s(j2num=\w+|\d+),\s(did=\d+),\s(email=\d+@\w+.\w+.\w+.\w+\|2),\s+(msgid=)<(\w+-\d+-\d+-\d+)>,\s |