-
Notifications
You must be signed in to change notification settings - Fork 0
4. Helpful Commands
Gabe edited this page Oct 17, 2024
·
2 revisions
The following is a list of helpful linux commands for anyone with root access to the server.
misc
-
cat /etc/passwd- list all users -
cat /etc/group- list all groups -
apt autoremove- remove unused packages -
su - csss-site- change to the csss-site user -
sudo systemctl start reboot.targetreboot machine
systemd
-
systemctl status csss-site- check if csss-site is running systemctl restart csss-sitesystemctl --type=service --state=running-
journalctl- see logs from any systemd service systemctl restart nginx
deploy the backend manually
ssh [email protected]
su - csss-site
./csss-site-backend/deploy.shpostgres
-
\du- list users in the database -
\list- list databases -
\c db- change to a database -
\dtor\dt+- see a list of tables -
\d tableor\d+ table- view details of table - SELECT * FROM table_name
-
\qto quit -
psql table_name -h localhost -p port -U usernameto connect to a remote database via command line
docker
-
docker ps -a- list all docker containers that are running or stopped docker start container-namedocker exec -it container-name bash
alembic
-
alembic upgrade headperform all outstanding migrations -
alembic downgrade -1remove last revision -
alembic show headto see the head revision