Semicolon & Sons
X
About
Contact & Support
Code Diary
Episodes
Blog
Subscribe
Sign in
Semicolon & Sons
About
Screencasts
Code Diary
Blog
Contact & Support
Subscribe
Sign In
Unix Code Diary Entries
This is part of the Semicolon&Sons
Code Diary
- consisting of lessons learned on the job.
Add timestamps to every line
Avoid referencing a folder name within code inside that folder
Awk
Bash script settings
Bits about permission bits
Colored output breaks pipes
Command grouping and signals
Cron job basics
Debugging a 100 percent CPU process
Detach process
Detached commands fail too silently
Difference between sleep and wait
Do not rely on the the HOME variable being available in system scripts
Ffmpeg snippets
File not found errors should provoke thoughts about ownership and permissions
File systems
Filepaths are relative to current working directory
Find a file across entire file system
Find command
Get subprocesses to stop
Get your numerical user id
Heredoc
How do keyboards and mice and power buttons work
How does fork's behavior differ in child process
How is autofs used in unix init booting
How to debug too many files open errors
How to debug with ltrace
How to diff oneline files
How to fill RAM in unix
How to give your program a blank ENV
How to guess missing dependencies with apt get
How to keep track of process progress without hanging
How to read CPU load measures
How to source file in same dir
How to tell whether a private key is password protected
If a file you have permissions for will not delete assume it is a folder
Ignore illegal byte sequences
Immutable attributes
IO select
Journalctl
Kill vs term vs int vs quit signals
Kill with negative numbers
Killing a parent process does not kill forked child
Learn to read diff
List all users on a system
Ln will work even if file does not exist
Makefile installer example
Makefile tricks
Mount
My fav jq commands
Never assume set e works with 3rd party code
Non iteractive shell
Output appearing where terminal input should may indicate forgetting to close a pipe
Overview of systemd daemons
Pass through scripts can modify paths
Paths are relative by default
Permission denied when redirecting to sudo file
Prefer mkdir p in all scripts
Primary on octal notation
Prints errors to STDERR never STDOUT
Process niceness
Process substitution
Properties of exec created processes
Pseudo devices
Put sockest and pids in run folder
Recursive copy woes
Remove all files in current dir safely
Rg
Run command as another user
Sed
See what processes share a pipe and what goes through
SFTP basics
Sockets
Sort
Spawn vs fork
Sponge
Ssh setup
Stick bit
Sudo changes the PATH
Sudo may counter intuitivly be the password free option
Symbolic vs hard links
Systemctl
Systemd
The confusing way ln handles relative paths
Things to consider when paging your program's output
Ufw basics
Understand problematic processes
Understand seeking
Understand shims
Uninstalling one package version does not stop its daemon
Uniq only makes consecutive items unique
Use awk over cut when more than one space in cols
Use braces to group output
Use nohup for scripts that should continue when you log out of server
Use rlimit to add soft and hard resource limits on subprocesses you create
Var tmp vs tmp
Wait vs (pthread )join
Wait with a negative pid to wait for any child
Watch out for ssh rate limits
What are cgroups
What are process groups
What does dbus do
What does synchronize do
What is a session leader
What is the usecase of dev shm
What is udev for
When parsing output of pipes connect both STDOUT and STDERR
Where do processes place runtime data
Where to place cache files and download files during program run
Xargs
Zero byte files may be folders