Skip to content

Commit 4d0aa6f

Browse files
committedJul 3, 2022
Create Linux-commands.md
1 parent f95bec4 commit 4d0aa6f

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed
 

‎shell-scripts/Linux-commands.md

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Linux Commands
2+
3+
## Shell
4+
5+
Shell => All the commands are fire on shell. The shell is working because it is fetching our all commands are providing the output.
6+
7+
### Some BRANDS in Shell
8+
9+
* Bourne shell (sh)
10+
* Korn shell (ksh)
11+
* Bourne Again shell (bash)
12+
* zsh and many more
13+
14+
## Commands
15+
- ``man 'utility_name'`` => Gives the manual of all command related to the given utilities
16+
- ``crtl + l`` => Clear the Screen
17+
- ``uname`` => Give the information what kind of system are you using
18+
- ``uname -a`` => All Details regardig information
19+
- ``uptime`` => show how much long your system in up
20+
21+
## Shell Commands
22+
#### Basic Commands
23+
- ``cd directory_name`` => Change Directory forward
24+
- ``cd..`` => Change Directory backward
25+
- ``cd`` => It gone directly to home directory
26+
- ``mkdir`` => Create a Empty Directory
27+
- ``ls`` => Listing all file in current Directory
28+
- ``ls -l`` => It gives a long listing version in the current directory
29+
- ``alias ll='ls -l'`` => This command aliasing the ll to ls -l
30+
- ``ls -a`` => It gives all the files including hidden file
31+
- ``vim file_name`` or ``nano file_name`` => It is default texy editor
32+
- In **vim** editor if you want to exit from this editor following the given steps:
33+
- Press the **esc** key.
34+
- At botton you see a **:** sign after this sign type **q**.
35+
- (q for quit surely it has more command).
36+
- Then Press **Enter** Key
37+
- ``date`` => It gives the current Day Date
38+
- ``cal`` => Gives Calander of the current Month.
39+
- ``w`` => Gives How many user are logged in your system.
40+
- ``whoami`` => It is useful to know from whoes credential you are logged in.
41+
- ``whereis utility_name`` => Gives the path of utility where it is install.
42+
- It only gives the path of that program are properly install in your computer and their path are set correctly.
43+
44+
#### Creating and Removing Commands
45+
- `` mkdir Directory_name`` => Creating a directory
46+
- "-rw-r--r" = If permission staring with **-** then it is file
47+
- "drwxr-xr-x" = If permission start with **d** then it is directory or folder
48+
- `` rm -r directory_name `` => It delete the directory which you have to pass.
49+
- **-r** tends to recursively delete that folder
50+
- Linux thing if you are deleting a directory then chances are high that it is surely contain more files and folder inside that directory.
51+
- So it is deleting the recursivily deleting that folder.
52+
- `` touch file_name.extension `` => It create a file
53+
54+
- `` history`` => It gives the history of previously used commands
55+
- ``history > file_name.txt`` => It redirect the history of commands into the file.
56+
- `` cat file_name `` => It is allow us to read the file.
57+
- ``head`` or ``tail`` => It is also allow us to read the file but only heading part (head) and footing part(tail)
58+
59+
60+
#### Permissions
61+
*Linux was designed to allow many users to access single system at the same time. Also fies need to be protected from each other.*
62+
- PERMISSION => Basically there are three types of permission in Linux.
63+
- Read
64+
- Write
65+
- Execute
66+
67+
* How to read Permissions ?
68+
* drwxr-xr-x 10 admin staff 320 28 jul 23:04 admin
69+
* **d** First word represent the which kind of file it is.(File[-], Directory[d])
70+
* **rwx** Represent the creator permission like root,admin.
71+
* **r-x** Represent the Groups permissions
72+
* **r-x** Represent the User permissions.
73+
* Number of the permissions:
74+
* x = 4 (Execute)
75+
* w = 2 (Write)
76+
* r = 1 (Read)
77+
- `` chmod 755 filename ``
78+
- 7 = 4+2+1 => Gives all permission to **Creator**
79+
- 5 = 4+1 => Gives the the Execute and Read Permission to **Group**
80+
- 5 = 4+1 => Gives the the Execute and Read Permission to **User**
81+
82+
83+
84+
*Many Times if we want to install some packages or softwares in our Linux based OS we need a permission of higher authority to successfully installl that things for that we use **sudo** keyword before fire actual installations commands of that package*

0 commit comments

Comments
 (0)