Skip to content

Commit d6785e0

Browse files
Merge pull request #99 from lukedev820/main
Added cheatsheet for Linux command line.
2 parents 96b6c35 + 7249340 commit d6785e0

File tree

2 files changed

+107
-8
lines changed

2 files changed

+107
-8
lines changed

CheatSheets/linux-cheatsheet.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
## Table of Contents
2+
---
3+
4+
- [Linux CheatSheet for Developers](#linux-cheatsheet-for-developers)
5+
- [File Commands](#file-commands)
6+
- [File Permissions](#file-permissions)
7+
- [Privilege Escalation](#privilege-escalation)
8+
- [SSH](#ssh)
9+
- [System Info](#system-info)
10+
- [Shortcuts](#shortcuts)
11+
- [Text Editors](#text-editors)
12+
13+
# Linux CheatSheet for Developers
14+
15+
## File Commands
16+
17+
| Command | Description |
18+
| ------- | ----------- |
19+
| `pwd` | Show current directory |
20+
| `mkdir dir` | Make directory called *dir* |
21+
| `cd dir` | Change directory to *dir* |
22+
| `cd ..` | Go up a directory |
23+
| `cd` | Change to home directory |
24+
| `ls` | List contents of directory|
25+
| `ls -al` | Formatted list of contents for the directory including hidden files |
26+
| `rm file` | Delete file |
27+
| `rm -r dir` | Delete directory *dir* |
28+
| `rm -f file` |Force delete file |
29+
| `rm -rf dir` | Force delete directory *dir* |
30+
| `cp file1 dir` | Copy *file1* to inside of *dir*|
31+
| `mv file1 dir` | Move/Cut *file1* to inside of *dir*|
32+
| `touch file` | Create *file*|
33+
34+
35+
**[🔼Back to Top](#table-of-contents)**
36+
37+
## File Permissions
38+
39+
| Command | Description |
40+
| ------- | ----------- |
41+
| `chmod octal file` | Change the permissions of file to octal for user, group and world by adding: **4 - read( r ), 2 - write( w ), 1- execute ( x )**|
42+
| `chmod 777 file` | Read, write, execute for all|
43+
| `chmod 755 file` | rwx for owner, rx for group and world.|
44+
45+
**[🔼Back to Top](#table-of-contents)**
46+
47+
## Privilege Escalation
48+
49+
| Command | Description |
50+
| ------- | ----------- |
51+
| `sudo command` | Runs *command* as root. (If a command requires a higher permission you might have to run it with sudo)|
52+
| `su` | Runs an interactive shell as root |
53+
54+
**[🔼Back to Top](#table-of-contents)**
55+
56+
## SSH
57+
58+
| Command | Description |
59+
| ------- | ----------- |
60+
| `ssh user@host` | Connect to host as user |
61+
| `ssh -p port user@host` | Connect to host on port *port* as user|
62+
63+
64+
**[🔼Back to Top](#table-of-contents)**
65+
66+
## System Info
67+
68+
| Command | Description |
69+
| ------- | ----------- |
70+
| `date` | Show the system date and time |
71+
| `cal` | Show this month's calendar |
72+
| `uptime` | Show system's uptime |
73+
| `w` | See who is online |
74+
| `whoami` | See who you are logged in as|
75+
| `uname -a` | Show kernel information |
76+
| `man command` | Show the manual for any command (exit with **q**)
77+
78+
**[🔼Back to Top](#table-of-contents)**
79+
80+
## Shortcuts
81+
82+
| Command | Description |
83+
| ------- | ----------- |
84+
| `Ctrl + C` | Halts the current command |
85+
| `Ctrl + D` | Log out of current session |
86+
| `Ctrl + W` | Erases one word in current line |
87+
| `Ctrl + U` | Erases entire line |
88+
89+
**[🔼Back to Top](#table-of-contents)**
90+
91+
## Text Editors
92+
| Command | Description |
93+
| ------- | ----------- |
94+
| `nano file` | nano is a small and friendly editor |
95+
| `vi file` | vi is a powerful text editor where every action is done though the keyboard. [How to exit vim/vi](https://www.cyberciti.biz/faq/linux-unix-exit-vim-editor/) (Trust me you'll need to know it) |
96+
| `vim file` | vim - Vi IMproved is an improved version of the vi editor. Like vi, every action is done through the keyboard.|
97+
98+
**[🔼Back to Top](#table-of-contents)**

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@ A Collections of programming [Cheat Sheets](./CheatSheets/) for developers to qu
3333
1. [git-cheatsheet.md](./CheatSheets/git-cheatsheet.md)
3434
2. [markdown-cheatsheet.md](./CheatSheets/markdown-cheatsheet.md)
3535
3. [windows-cheatsheet.md](./CheatSheets/windows-cheatsheet.md)
36-
4. [vscode-cheatsheet.md](./CheatSheets/vscode-cheatsheet.md)
37-
5. [chrome-devtools-cheatsheet.md](./CheatSheets/chrome-devtools-cheatsheet.md)
38-
6. [npm-cheatsheet.md](./CheatSheets/npm-cheatsheet.md)
39-
7. [nvm-cheatsheet.md](./CheatSheets/nvm-cheatsheet.md)
40-
8. [yarn-cheatsheet.md](./CheatSheets/yarn-cheatsheet.md)
41-
9. [python-cheatsheet.md](./CheatSheets/Python-cheatsheet.md)
42-
10. [html-cheatsheet.md](./CheatSheets/html-cheatsheet.md)
43-
11. [css-cheatsheet.md](./CheatSheets/css-cheatsheet.md)
36+
4. [linux-cheatsheet.md](./CheatSheets/linux-cheatsheet.md)
37+
5. [vscode-cheatsheet.md](./CheatSheets/vscode-cheatsheet.md)
38+
6. [chrome-devtools-cheatsheet.md](./CheatSheets/chrome-devtools-cheatsheet.md)
39+
7. [npm-cheatsheet.md](./CheatSheets/npm-cheatsheet.md)
40+
8. [nvm-cheatsheet.md](./CheatSheets/nvm-cheatsheet.md)
41+
9. [yarn-cheatsheet.md](./CheatSheets/yarn-cheatsheet.md)
42+
10. [python-cheatsheet.md](./CheatSheets/Python-cheatsheet.md)
43+
11. [html-cheatsheet.md](./CheatSheets/html-cheatsheet.md)
44+
12. [css-cheatsheet.md](./CheatSheets/css-cheatsheet.md)
4445

4546
## ___Instructions___
4647

0 commit comments

Comments
 (0)