Basic Replace Syntax:
Delete Line Containing String:
sed -i '/SEINFELD/d' filename
Delete Empty Lines:
Delete First Line:
sed '1,2d' filename
→ delete the first two lines
sed 's/\t/ /g' filename
→ replace tabs with spaces
sed -n '12,18p' filename
→ print only lines 12 to 18
sed '12,18d' filename
→ delete lines 12 to 18
sed G filename
→ insert an empty line after every line
sed '8!s/seinfeld/S1/' filename
→ replace "seinfeld" with "S1" on every line except line 8
Vi Editor Commands
i
→ insert mode
I
→ insert at line start
ESC
→ escape to command mode
R
→ replace mode
x
→ delete character
dd
→ delete line
yy
→ copy line
p
→ paste
v
→ visual mode
o
→ open new line below and insert
O
→ open new line above and insert
a
→ append after cursor
A
→ append at end of line
:q!
→ quit without saving
:wq
or ZZ
→ save and quit
Crontab Basics
crontab -e
→ edit crontab
crontab -l
→ list crontab entries
crontab -r
→ remove crontab entries
systemctl status crond
→ check crond service status
AT: One-time Scheduled Tasks
Used to schedule jobs only once.
Scheduling Examples:
at HH:MM PM
→ schedule a job interactively
at 11:23AM 12/24/25
Enter job (e.g., echo "test"
) and press Ctrl + D
to finish
at 2:45PM 01/30/25
at 4PM + 4 days
at now + 5 hours
at 8:00AM Sun
at 10:00AM next month
Managing AT Jobs
atq
→ list the scheduled at jobs
atrm #
→ remove a specific at job (use number from atq
)
systemctl status atd
→ check atd daemon status
Fold
Fold all
Expand
Expand all
Are you sure you want to delete this link?
Are you sure you want to delete this tag?
The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community