vi editor save without exit from editor

vi shell linux 4 years, 7 months ago
:wq # will save and exit :w # will save :q! # exit without saving
931
Posted By
Get linux disk details using windows powershe
$computer = "172.16.15.7"
$linuxcredentils = Get-Credential -Messa

windows disks linux powershell
abhi abhi
Linux Navigation
pwd  #print the name of current working 
cd  #change directory
ls #List directory contents
linux shell
Ramya Ramya
Finding usage of the file system in linux usi
import subprocess
threshold = input("Enter the threshold v
child = subprocess.Popen(['df','-h'],std
python linux subprocess
Ramya Ramya
Shell Script to Monitor Site with Json conten
a=`curl --insecure -I SITE-NAME | awk 'N
b=`wget -qO- --no-check-certificate SITE
if [[ "$a" -eq 200 ]]; then
shell Site-Monitor
sandeep sandeep
Shell Script to Generate the SSH key and disp
export PATH=$WORKSPACE/resources/chromed
export PYTHONPATH=$WORKSPACE

shell auto ssh key
sandeep sandeep
Run shell files in javascript
//JS Code
function runShellScript(){
    const process = require('child_proce
javascript shell node js
harika
copy a file and replace with another or origi
# way1

cp -f /path/to/file1.txt /another/path/t
shell
kishore_kumar
Rename or change git branch name
git branch -m <old-name> <new-name>
git push origin :<old-name> <new-name>
git shell
kishore_kumar
To delete all the none docker images in singl
docker rmi $(docker images | grep "^<non
shell docker
ashokrebel007 ashokrebel007
Remote copying (One centos machine to another
scp filename username@ipaddress:destinat

For example :
shell centos
ashokrebel007 ashokrebel007
Gitlab tags
git tag -a versionnumber -m "versionmess
git push origin versionnumber
git shell
ashokrebel007 ashokrebel007
Return a string from shell function
#!/bin/sh

hello()
string shell
harika
How to check the logs around or at particular
#If you want to check the logs since 1 h
git log --since="1 hour ago"

git shell
harika
How to untrack/ unstage a file i.e already tr
git reset HEAD fileName.txt
git shell
harika
get logs in oneline / readable form in git
git log --oneline --graph --decorate
git shell
harika
Create alias in gitconfig from commandline
#here i am trying to make the one line l
git config --global alias.sLog "log --on

git shell
harika
Stop or remove all docker containers command
# docker ps -a -q  -> will return all id
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
shell docker
kishore_kumar
How to find the port which is running and sto
sudo lsof -i tcp:port //To find the port

kill pid //kills the process which is ru
shell kill port
Reshma
How to uninstall docker from mac
#!/bin/bash

# Uninstall Script
shell docker remove mac
Reshma
How to unzip file in terminal
unzip file_name
shell unzip
Reshma