-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinux-commands.html
386 lines (351 loc) · 17 KB
/
linux-commands.html
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Linux Command Encyclopedia</title>
<link rel="icon" type="image/x-icon" href="https://upload.wikimedia.org/wikipedia/commons/3/35/Tux.svg">
<!-- Recommended for better browser support -->
<style>
:root {
--primary: #2a2a2a;
--secondary: #1a1a1a;
--accent: #00ff88;
--text: #ffffff;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Fira Code', monospace;
}
.command-card {
cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="%2300ff88"><path d="M13 3v10h-2V3h2zm7.71 9.29l-9-9a1 1 0 0 0-1.42 0l-9 9a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0L12 5.41l8.29 8.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z"/></svg>'), pointer;
}
.command-card:hover {
cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="%2300ff88"><path d="M13 3v10h-2V3h2zm7.71 9.29l-9-9a1 1 0 0 0-1.42 0l-9 9a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0L12 5.41l8.29 8.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z"/></svg>'), pointer;
}
body {
cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%2300ff88" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4h16v16H4zM12 12v4m0-4h4m-4 0l4-4m0 0v4m0-4h-4m4 0l-4 4"/></svg>'), auto;
}
.command-card {
cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%2300ff88" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 8v4m0 4h.01"/></svg>'), pointer;
}
.search-box {
cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%2300ff88" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/></svg>'), text;
}
body {
background: var(--primary);
color: var(--text);
line-height: 1.6;
padding: 20px;
}
.container {
max-width: 1200px;
margin: 0 auto;
}
.search-box {
width: 100%;
padding: 15px;
font-size: 1.2em;
background: var(--secondary);
border: 2px solid var(--accent);
color: var(--text);
border-radius: 8px;
margin-bottom: 30px;
transition: all 0.3s ease;
}
.search-box:focus {
outline: none;
box-shadow: 0 0 15px var(--accent);
}
.category {
margin-bottom: 40px;
background: var(--secondary);
padding: 20px;
border-radius: 12px;
border-left: 5px solid var(--accent);
}
.category h2 {
color: var(--accent);
margin-bottom: 20px;
text-transform: uppercase;
letter-spacing: 2px;
}
.command-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 15px;
}
.command-card {
background: var(--primary);
padding: 15px;
border-radius: 8px;
border: 1px solid #3a3a3a;
transition: transform 0.3s ease;
cursor: pointer;
}
.command-card:hover {
transform: translateY(-5px);
border-color: var(--accent);
}
.command-name {
color: var(--accent);
font-weight: bold;
margin-bottom: 10px;
}
::-webkit-scrollbar {
width: 10px;
}
::-webkit-scrollbar-track {
background: var(--primary);
}
::-webkit-scrollbar-thumb {
background: var(--accent);
border-radius: 4px;
}
.highlight {
background: yellow;
color: black;
}
.footer {
margin-top: 50px;
padding: 20px;
text-align: center;
color: var(--text);
border-top: 1px solid var(--accent);
backdrop-filter: blur(5px);
}
.github-link {
color: var(--accent);
text-decoration: none;
font-weight: bold;
transition: all 0.3s ease;
margin-left: 10px;
}
.github-link:hover {
color: #00cc77;
text-decoration: underline;
text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}
</style>
</head>
<body>
<div class="container">
<h1>📜 Linux Command Encyclopedia</h1>
<input type="text" class="search-box" placeholder="🔍 Search command...">
<div id="commands-container">
<!-- Commands will be inserted here -->
</div>
</div>
<div class="footer">
Developed by
<a href="https://github.com/CodeWithTanim" class="github-link" target="_blank" rel="noopener noreferrer">
@CodeWithTanim
</a>
</div>
<script>
const commands = [
{
category: "File Operations",
commands: [
{ name: "ls", desc: "List directory contents" },
{ name: "cd", desc: "Change directory" },
{ name: "cp", desc: "Copy files/directories" },
{ name: "mv", desc: "Move/rename files" },
{ name: "rm", desc: "Remove files/directories" },
{ name: "touch", desc: "Create empty file" },
{ name: "cat", desc: "Display file content" },
{ name: "chmod", desc: "Change file permissions" },
{ name: "chown", desc: "Change file owner" },
{ name: "find", desc: "Search for files" },
{ name: "mkdir", desc: "Create a directory" },
{ name: "rmdir", desc: "Remove an empty directory" },
{ name: "ln", desc: "Create hard/soft links" },
{ name: "tar", desc: "Archive files" },
{ name: "gzip", desc: "Compress files" },
{ name: "zip", desc: "Compress files into a zip archive" },
{ name: "unzip", desc: "Extract zip files" },
{ name: "rsync", desc: "Sync files/directories" },
{ name: "scp", desc: "Securely copy files over SSH" },
{ name: "du", desc: "Estimate file space usage" },
{ name: "stat", desc: "Display file status" },
]
},
{
category: "System Info",
commands: [
{ name: "uname", desc: "Show system information" },
{ name: "top", desc: "Display running processes" },
{ name: "htop", desc: "Interactive process viewer" },
{ name: "df", desc: "Disk space usage" },
{ name: "free", desc: "Memory usage" },
{ name: "lscpu", desc: "CPU information" },
{ name: "lsblk", desc: "Block device information" },
{ name: "uptime", desc: "System uptime" },
{ name: "whoami", desc: "Display current user" },
{ name: "id", desc: "Show user and group info" },
{ name: "hostname", desc: "Show system hostname" },
{ name: "date", desc: "Display system date and time" },
{ name: "cal", desc: "Display calendar" },
{ name: "env", desc: "Display environment variables" },
{ name: "lshw", desc: "List hardware information" },
{ name: "dmidecode", desc: "Display hardware info from BIOS" },
]
},
{
category: "Networking",
commands: [
{ name: "ping", desc: "Test network connectivity" },
{ name: "ifconfig", desc: "Network interface configuration" },
{ name: "netstat", desc: "Network statistics" },
{ name: "ssh", desc: "Secure shell client" },
{ name: "scp", desc: "Secure file copy" },
{ name: "wget", desc: "File downloader" },
{ name: "curl", desc: "Data transfer tool" },
{ name: "traceroute", desc: "Network path analysis" },
{ name: "nslookup", desc: "Query DNS servers" },
{ name: "dig", desc: "DNS lookup utility" },
{ name: "nmap", desc: "Network security scanner" },
{ name: "iptables", desc: "Firewall configuration" },
{ name: "route", desc: "Display routing table" },
{ name: "host", desc: "DNS lookup utility" },
{ name: "telnet", desc: "Connect to remote hosts" },
{ name: "nc", desc: "Netcat - networking utility" },
]
},
{
category: "Package Management",
commands: [
{ name: "apt-get", desc: "Debian package manager" },
{ name: "yum", desc: "RHEL package manager" },
{ name: "dnf", desc: "Modern Fedora package manager" },
{ name: "pacman", desc: "Arch Linux package manager" },
{ name: "snap", desc: "Universal package manager" },
{ name: "pip", desc: "Python package manager" },
{ name: "npm", desc: "Node.js package manager" },
{ name: "gem", desc: "Ruby package manager" },
{ name: "flatpak", desc: "Universal package manager" },
{ name: "zypper", desc: "SUSE package manager" },
{ name: "rpm", desc: "RPM package manager" },
]
},
{
category: "Process Management",
commands: [
{ name: "ps", desc: "Process status" },
{ name: "kill", desc: "Terminate processes" },
{ name: "pkill", desc: "Kill processes by name" },
{ name: "bg/fg", desc: "Background/foreground processes" },
{ name: "jobs", desc: "List background jobs" },
{ name: "nice", desc: "Set process priority" },
{ name: "renice", desc: "Change process priority" },
{ name: "nohup", desc: "Run processes after logout" },
{ name: "pgrep", desc: "Find processes by name" },
{ name: "killall", desc: "Kill processes by name" },
{ name: "systemctl", desc: "Control systemd services" },
{ name: "service", desc: "Manage system services" },
]
},
{
category: "Text Processing",
commands: [
{ name: "grep", desc: "Search text using patterns" },
{ name: "awk", desc: "Text processing language" },
{ name: "sed", desc: "Stream editor for text manipulation" },
{ name: "cut", desc: "Remove sections from lines" },
{ name: "tr", desc: "Translate or delete characters" },
{ name: "wc", desc: "Count lines, words, and characters" },
{ name: "sort", desc: "Sort lines of text" },
{ name: "uniq", desc: "Remove duplicate lines" },
{ name: "diff", desc: "Compare files line by line" },
{ name: "tee", desc: "Redirect output to multiple files" },
{ name: "head", desc: "Display first lines of a file" },
{ name: "tail", desc: "Display last lines of a file" },
{ name: "less", desc: "View file content interactively" },
{ name: "more", desc: "View file content page by page" },
]
},
{
category: "User Management",
commands: [
{ name: "useradd", desc: "Add a new user" },
{ name: "userdel", desc: "Delete a user" },
{ name: "usermod", desc: "Modify user settings" },
{ name: "passwd", desc: "Change user password" },
{ name: "groupadd", desc: "Add a new group" },
{ name: "groupdel", desc: "Delete a group" },
{ name: "groups", desc: "Show user groups" },
{ name: "su", desc: "Switch user" },
{ name: "sudo", desc: "Execute as superuser" },
{ name: "visudo", desc: "Edit sudoers file" },
]
},
{
category: "System Administration",
commands: [
{ name: "shutdown", desc: "Shutdown or restart system" },
{ name: "reboot", desc: "Restart system" },
{ name: "cron", desc: "Schedule tasks" },
{ name: "crontab", desc: "Edit cron jobs" },
{ name: "logrotate", desc: "Rotate log files" },
{ name: "journalctl", desc: "View system logs" },
{ name: "dmesg", desc: "View kernel messages" },
{ name: "fdisk", desc: "Partition table manipulator" },
{ name: "mount", desc: "Mount filesystems" },
{ name: "umount", desc: "Unmount filesystems" },
{ name: "fsck", desc: "Check and repair filesystems" },
{ name: "blkid", desc: "Show block device attributes" },
{ name: "lsusb", desc: "List USB devices" },
{ name: "lspci", desc: "List PCI devices" },
]
}
];
// Render commands
const container = document.getElementById('commands-container');
commands.forEach(category => {
const categoryHTML = `
<div class="category">
<h2>${category.category}</h2>
<div class="command-grid">
${category.commands.map(cmd => `
<div class="command-card" data-name="${cmd.name.toLowerCase()}" data-desc="${cmd.desc.toLowerCase()}">
<div class="command-name">$${cmd.name}</div>
<div class="command-desc">${cmd.desc}</div>
</div>
`).join('')}
</div>
</div>
`;
container.innerHTML += categoryHTML;
});
// Fixed search functionality
const searchBox = document.querySelector('.search-box');
searchBox.addEventListener('input', (e) => {
const searchTerm = e.target.value.toLowerCase().trim();
const commandCards = document.querySelectorAll('.command-card');
commandCards.forEach(card => {
const cmdName = card.dataset.name;
const cmdDesc = card.dataset.desc;
const nameElement = card.querySelector('.command-name');
const descElement = card.querySelector('.command-desc');
if (searchTerm === '' || cmdName.includes(searchTerm) || cmdDesc.includes(searchTerm)) {
card.style.display = 'block';
// Reset content before applying new highlights
nameElement.innerHTML = `$${cmdName}`;
descElement.innerHTML = card.dataset.desc;
if (searchTerm) {
const regex = new RegExp(searchTerm, 'gi');
nameElement.innerHTML = nameElement.innerHTML.replace(regex,
match => `<span class="highlight">${match}</span>`);
descElement.innerHTML = descElement.innerHTML.replace(regex,
match => `<span class="highlight">${match}</span>`);
}
} else {
card.style.display = 'none';
}
});
});
</script>
</body>
</html>