Tag Archives: CLI Reference

Manage System-d services

OperationCommand
View servicessudo systemctl list-unit-files –type=service
Startsudo systemctl start application.service
sudo systemctl start application
Stopsudo systemctl stop application.service
sudo systemctl stop application
Restartsudo systemctl restart application.service
Reloadsudo systemctl reload application.service
Enable/disablesudo systemctl enable application.service
Statussystemctl status application.service

Vagrant CLI Reference

Note: You should use the commands in the same directory with the vagrant file.

Basic management

DescriptionCommand
List of processesvagrant global-status
Create or start processvagrant up
Reconfigure existing processvagrant provision
Reboot processvagrant reload
Shutdown processvagrant halt
Connect via SSHvagrant SSH
Destroy the imagevagrant destroy

Authoring commands

DescriptionCommand
vagrant initCreate new vagrantfile
vagrant shareShare the image
vagrant snapshot pushPush a copy to the snapshot stack
vagrant snapshot listList stack contents
vagrant snapshot restore IDRestore a specific snapshot

Run without environment variables

env -u GEM_HOME -u GEM_PATH vagrant

Docker CLI Reference

Reference

CommandDescription
systemctl start docker
systemctl status docker
systemctl stop docker
docker info
docker version
start docker
view docker process status
stop docker
view docker info
view docker version
docker images
docker image ls
docker search ubuntu
docker pull ubuntu
docker rmi ubuntu
docker image rm
view image list
view image list ( > v1.13)
search for an image
download an image
delete an image
delete an image ( > v1.13)
docker ps -a
docker ps -l
docker container ls
docker container rm <cid>
docker rm <cid>
view running containers
view all containers
view containers ( > v1.13)
delete container with id <cid>
delete container with id <cid>
docker run imagename
docker run –name bla imagename
docker run -it ubuntu
docker start <cid>
docker stop <cid>
docker stop $(docker ps -q)
docker stats <cid>
docket top <cid>
docker kill<cid>
create and run a container
create and run a named container
create interactive session
start an existing container
stop a container
stop all running containers
view running stats of a container
view top stats of a container
kill a running container
docker attach <cid>
docker exec -it ubuntu bash
reconnect to a running container
Open a new terminal window

How to detach

How container was startedhow to detach
-t and -i is used to launch the containerctrl + P and then ctrl + Q
-t is used to launch the containerctrl + C
otherwisepkiill

Examples

sudo docker run --detach \
  --hostname gitlab.example.com \
  --publish 443:443 --publish 80:80 --publish 22:22 \
  --name gitlab \
  --restart always \
  --volume /srv/gitlab/config:/etc/gitlab \
  --volume /srv/gitlab/logs:/var/log/gitlab \
  --volume /srv/gitlab/data:/var/opt/gitlab \
  gitlab/gitlab-ce:latest

References: