Shell Code Samples



Filters


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

kill pid //kills the process which is r
shell kill port
how to modify symlink in linux
kishore_kumar | 2 years, 3 months
ln -sfn <source_path> softlink_name
shell
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 unzip tar file through cli
Reshma | 4 years, 1 month
tar -xvf filename.tgz
cli shell tar
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 | 5 years
git log --oneline --graph --decorate
git shell
Rename or change git branch name
kishore_kumar | 5 years, 3 months
git branch -m <old-name> <new-name>
git push origin :<old-name> <new-name>
git shell
ashokrebel007
Gitlab tags
ashokrebel007 | 5 years, 3 months
git tag -a versionnumber -m "versionmessage"
git push origin versionnumber
git shell
How to uninstall docker from mac
Reshma | 4 years, 8 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, 3 months
#!/bin/sh

hello()
string shell
Prev Next