-
Notifications
You must be signed in to change notification settings - Fork 3
/
Linux
126 lines (57 loc) · 1.95 KB
/
Linux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
192.168.137.131
To Login linux machines
========================
ssh <username>@<IP>
ssh -i <private_key> <user_name>@<IP>
PWD ---> Present working directory
ifconfig ---> to check ip address of linux
ipconfig ----> to check ip address for windows
su root ------> to switch root user_name
su <user_name> -------> to switch users
cd .. ----> one step back
cd - -----> previous directory
ls -----> list of the directory
ls -ltra
---> l is a long list
---> t is a time
---> r is a reverse
---> a is a hidden files
touch <file_name> ---> to create empty file.
cat <file_name> ----> To view file
cat > <file_name> ----> To create content file and overide
cat >> <file_name> ----> to append content in the file
rm ---> to remove file
-f <file__name> --> remove forcefully
mkdir <directory1_name> ----> to create directory
rm -rf <directory_name> -----> To remove directory
cp <source/<file_name>> <dest> ---> To copy files
mv <file_name/directory_name> -----> to move file/directory
useradd <user_name> ------> to add user_name
userdel <user_name> -----> To delete user
groupadd <group_name> -----> To create group_name
groupdel <group_name> -----> To delete group
file/directory permissions
- rwx r-x r-- root root file1
file/di user group others user group
-rwxr-xr--
chmod 4+2+1 4+0+1 4+0+0 file1
chmod -r
- file
r---> read ----> 4
w ---> write -----> 2
x --> exicution ----> 1
chown 700 <file_name> ------> To change owner permissions for file
chown -R <permissions> <directory_name> ------> To change owner permissions for Directory
To change Hostname
vi /etc/hostname
<hostname>
:wq
vi /etc/hosts
append (<ip> <hostname>)
:wq
hostname -F /etc/hostname ---> To forcefully change hostname
hostname ----> to check host name
[harikrishna123@localhost ~]$
/home/harikrishna123
[root@localhost harikrishna123]#
/