Skip to content

awesomedan93/linux-useful-commands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 

Repository files navigation

linux-useful-commands

docker

display docker containers not wide terminal

docker ps | less -S

get ip of all running containers

docker inspect -f '{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq)

git useful commands

create a branch from a specific commit

git checkout commit_id
git checkout -b new_branch_name
git push -u origin new_branch_name

pull from a another branch - only specific commit

git cherry-pick <commit-hash>

general commands

copy files from server A to B (remote)

scp -r -i  ~/.ssh/key.pem /home/user/Desktop/source/  user@host_address:/var/www/destination/path

copy files from server B (remote) to A

scp -r user@host_address:/var/www/source /home/user/Desktop/

copy files from server A to B (remote) using rsync and pem key for ssh

rsync -avh -e "ssh -i ~/.ssh/example.pem" /home/user/Desctop/source root@192.168.0.100::/var/www/destination/path

querying DNS

dig example.com

linux alias

alias l="ls -al"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors