Shell Code Samples



Filters


How to find the port which is running and stop the process
Reshma | 4 years, 7 months
sudo lsof -i tcp:port //To find the port which is running

kill pid //kills the process which is r
shell kill port
Run shell files in javascript
harika | 5 years, 10 months
//JS Code
function runShellScript(){
    const process = require('child_process'); 
keep the function code inside the js file wherever you want to use. and keep the shell file provided
javascript shell node js
how to modify symlink in linux
kishore_kumar | 2 years, 2 months
ln -sfn <source_path> softlink_name
shell
Stop or remove all docker containers command
kishore_kumar | 4 years, 10 months
# docker ps -a -q  -> will return all ids of all containers
docker stop $(docker ps -a -q)
docker 
shell docker
get logs in oneline / readable form in git
harika | 4 years, 11 months
git log --oneline --graph --decorate
git shell
Rename or change git branch name
kishore_kumar | 5 years, 2 months
git branch -m <old-name> <new-name>
git push origin :<old-name> <new-name>
git shell
ashokrebel007
Gitlab tags
ashokrebel007 | 5 years, 2 months
git tag -a versionnumber -m "versionmessage"
git push origin versionnumber
git shell
How to unzip tar file through cli
Reshma | 4 years
tar -xvf filename.tgz
cli shell tar
How to uninstall docker from mac
Reshma | 4 years, 7 months
#!/bin/bash

# Uninstall Script
run it with sudo bash uninstall.sh
shell docker remove mac
Return a string from shell function
harika | 5 years, 2 months
#!/bin/sh

hello()
string shell
Prev Next