Created
August 17, 2021 00:24
-
-
Save ixtiyoruz/4f8dd9c8a4081c604901b119589537b8 to your computer and use it in GitHub Desktop.
useful commands linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
to replace the word with another word in given files. | |
'replace "bottle" "box" -- ./images/*.xml' |
to merge two branches
git checkout updating_branch_name
git merge branch_name_to_copy_from
write text to a file :
echo "Hello you!" >> myfile.txt
echo "this is 2nd line text" >> file.txt
echo "last line!" >> file.txt
serve files inside directory
python3 -m http.server 8007
to give the docker command permission to display things
xhost +local:root
in order to use nvidia while building docker use this https://stackoverflow.com/questions/67570694/how-to-build-yolact-using-docker
To do smth for every nth file in a folder
find 192.168.0.111 -type f | awk 'NR %1000 == 0'| xargs du -sh
Docker display example
--net allows the docker image to use host ip.
x11 things allows to use the dispaly
-e DISPLAY=:1 gives the display number.
code_folder="path"
docker run --rm -e DISPLAY=:1 --net=host -v /tmp/.X11-unix:/tmp/.X11-unix -v ${code_folder}:/home/code -it docker_image_name
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
to create a new branch
git checkout -b new_branch_name branch_name_to_copy
git push -u origin new