Skip to content

Latest commit

 

History

History
92 lines (69 loc) · 1.58 KB

linux-commands.md

File metadata and controls

92 lines (69 loc) · 1.58 KB

Linux Commands

ls: list directories

# List directories
ls

# List all directories + hidden directories
ls -a

mkdir: Create directory

# Create folder - Replace <folder name>
mkdir <folder name>

# Create 2 folders
mkdir <folder name> <folder name2>

# Create moei folder
mkdir moei

cd: go to directories

# Go to home , root directory
cd

# Go to custom directory by replacing <directory path>
cd <directory path>

# Go to moei
cd moei

# Go to parent directory
cd ..

mv: Move files & Directories

# mv <source> <destination>

rm

# Remove a file
rm -rf <file>

# Remove a file in a directory
rm -rf <directory/file>

nano

# Open edit menu of a file / if file doesn't exist, it creates it
nano <file>

# CTRL + X + Y + ENTER to save & Exit

git

# Transfer a github repository into linux
git clone https://github.com/0xmoei/Linux_Node_Guide

Screen

  • Sometimes we need a process to be running in the background while we exit the terminal and VPS
  • We can open a screen then enter our node commands in it
  • if we close the screen, we can return to it later
# Install
sudo apt install screen

# Open a screen
screen -S <screen-name>

# Close screen
CTRL + A + D

# Screens list
screen -ls

# Return to screen
screen -r <screen-name>