A Draft Note of Things to Know about Linux

Image source: amandablesing.com
dh -hT
df -ah -- check disk free space
du -sh dir/ -- check total size of everything inside a director
netstat -tulpn -- check for port that being used
sudo netstat -tulpn | grep LISTEN -- u wanna run this as root to see PID and program or service nameps aux | grep tomcat
top -- show all process info
htop -- show a more beautify layout (u can search through it)
man <cmd name> -- to learn more about a command
cp /app/myscriptexec /etc/init.d
ln -s /etc/init.d/myscriptexec /etc/rc3.d/myscriptexec
ln -s /etc/init.d/myscriptexec /etc/rc5.d/myscriptexec
/etc/init.d/myscriptexec start
service --status-all
service tomcat status
systemctl --type=service
systemctl status tomcat
lsof

Linux file permissions

ls -i -- list file with their inodes number
stat file.txt -- will display all the inodes info about the file
df -f or df -ih -- will show the usage of inodes on the disk
ps -ef | grep java -- check if java process is running 
ps -ef | grep logging
ps -ef | grep tomcat -- check if tomcat process is running
grep abc file.txt -- search for 'abc' in file.txt
grep -n abc file.txt -- search for 'abc' in file.txt and show which line

Linux file system and structure

Watching, Tailing, and Following

$ watch -n 5 free -m
$ service jira status$ tail -f /opt/atlassian/jira/logs/catalina.out

Cheers!!

--

--

--

Chief Information Officer @ITOT Africa | Lead Senior Site Reliability Engineer @ICF󠁧󠁢󠁳󠁣󠁴 | "Learning is experience; everything else is just information!”

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Developer Showcase #1: Brian Whalley, Co-Founder of Wonderment

Can I Get You a Java….Script?

Self-hosting behind a NAT

High Scale Web Server With Kubernetes - Part II

3 simple steps to improving your team’s Cross-Functional Dysfunction

Legacy code cringe

Making a Discord Bot for Nintendo 3DS

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Yann Mulonda

Yann Mulonda

Chief Information Officer @ITOT Africa | Lead Senior Site Reliability Engineer @ICF󠁧󠁢󠁳󠁣󠁴 | "Learning is experience; everything else is just information!”

More from Medium

GIT — Minimum commands to work like professional — Part 2

Getting started with Shell Scripting in 5 easy steps

Linux Shell Scripting

Setup up environment for C Programming

Master Object-Oriented C Programming Through Books