Giter Site home page Giter Site logo

linux-cheat-sheet's Introduction

Cheat Sheet - #Linux

My most used Linux commands

Indice

Subtitle

Input Description
[ ] Brackets only represent a user input (what you have to type)
[file] Type a file name + extension (".txt", ".css", ".js", etc)
[folder] Type a folder name
[directory] Type a directory path
[word] Type a Word
[host] Type a remote computer name + IP address (example: [email protected])
[PID] Type a process ID. It's a number listed in "top" or "ps" command and identifies the process
[site] Type a site name or IP address

Subtitle Example

  • Command description: touch [file]
  • Desired input #1: touch myFile.html
  • Desired input #2: touch hello.txt

Below, the commands are organized in groups:

File Editing

Command Description
nano [file] Open file to edit
mv [file] [file / directory] Rename/move file
cp [file] [directory] Copy to directory
rm -rf [file] Remove file (r = recursive, f = force)
rm *[file] Wildcard: remove all files with same letter combination or extension

Wildcard Example

rm *[file] Description
rm * Remove all files
rm *.js Remove all javascript files
rm a*.txt Remove all text files beginning with the letter "a"

File info

Command Description
list -l List files with detailed info (l = long)
list -a List visible & insisible files (a = all)
cat [file] Concatenate: print file content
head [file] Print file's first 10 lines
tail [file] Print file's last 10 lines
less [file] Print file with navigation
grep [word] [file] Search word in file and print corresponding line
find -name [file] Find file directory

File / Folder Creation

Command Description
touch [file] Create file
mkdir [folder] Create folder
echo [word] > [file] Write word inside file

Command Info

Command Description
man [command] Get documentation about command
history [command] Get the list of all typed commands
CTRL + R [command] Reverse i-search: find command from history, based on typed input
cd ~/.bash_history Go to invisible file in the HOME directory, which contains command history log

SSH Key for Remote Access

Command Description
ssh-keygen Create SSH key pair
ls .ssh Confirm if SSH key was created
ssh-copy-id [host] Copy SSH key to remote computer
ssh [host] Login remote computer with SSH

Network Troubleshooting

Command Description
ifconfig Get network info
hostname -I Get IPV4 & IPV6 info
route Check if "default" line has IP, and if so, you can contact servers outside the local network
ping [site] Check "packet loss" summary to see if you have a good internet connection
whois [site] Get all info about domain names registered on the Internet
whois [site] | grep [word] Search for word inside "whois" command (| = group commands together)
whois [site] | head Get first 10 lines of "whois" command

Process Management

Command Description
top List processes executing in the computer
ps Similar to "ls" command, but for processes
ps aux More detailed info to "ps" command
kill [PID] Kill process

linux-cheat-sheet's People

Contributors

joakimteixeira avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.