TGViewer
Linux - Reddit Linux - Reddit @r_linux · 1.05K subscribers
Post #43122 22
strcmp(sure, "Y") == 0) {

pid_t pid = fork();

if (pid == 0) {

char *args[\] = {"sudo", "rm", rm_file, NULL};

execvp(args[0\], args);

perror("failed execvp");

exit(1);

}

else {

wait(NULL);

}

} else {

return;

}

}

void systeminfo(void)

{

pid_t pid = fork();

if (pid == 0) {

char *args[\] = {"sh", "-c", "ls && lsblk && ls /", NULL};

execvp(args[0\], args);

perror("failed execvp");

exit(0);

}

else {

wait(NULL);

}

}

void rep(void)

{

while(1) {

char rep_cmd[50\];

printf(" what do you want?\\n"

"<how to see info of system linux>\\n"

"<how to get remove file in this system>\\n"

"<how to get install pkg>\\n"

"c_cpp_helper\\n"

"<how to install wsl in this system \\\\ powershell>: ");

fgets(rep_cmd, sizeof(rep_cmd), stdin);

rep_cmd[strcspn(rep_cmd, "\\n")\] = '\\0';

if (strcmp(rep_cmd, "how to see info of system linux") == 0) {

printf("in your terminal , getting command ls, lsblk, ls /, whoami, in this system, you command the systeminfo\\n");

} else if (strcmp(rep_cmd, "how to get remove file in this system") == 0) {

printf(" in your terminal, getting command rm and your file path
wanted to remove, in this system you command rm and write the path
file\\n");

} else if (strcmp(rep_cmd, "how to get install pkg") == 0) {

printf("sudo and your pkg and your pkg , in this system, just command inst and select pkgmanager, select pkg\\n");

} else if (strcmp(rep_cmd, "how to install wsl in this system \\\\ powershell") == 0) {

printf(" you really use window bruhhh haha, just command wsl
\--install Ubuntu or in this system, just command wslinstubuntu\\n");

} else if (strcmp(rep_cmd, "c_cpp_helper") == 0) {
printf("command the c\\_cpp\\_helper for the c and c++ helper");
} else {

exit(0);

}

}

}

int main(void) {

char user_input[256\];

while(1) {

input_cmd(user_input, sizeof(user_input));

if (strcmp(user_input, "wslinstubuntu") == 0) {

wslinstubuntu();

} else if (strcmp(user_input, "inst") == 0) {

inst();

} else if (strcmp(user_input, "rm") == 0) {

rm();

} else if (strcmp(user_input, "systeminfo") == 0) {

systeminfo();

} else if (strcmp(user_input, "c_cpp_helper") == 0) {
c\\_cpp\\_helper();
} else if (strcmp(user_input, "rep") == 0) {

rep();

} else if (strcmp(user_input, "exit") == 0) {

break;

} else {

printf("not found ***\\n");

}

}

return 0;

}

https://redd.it/1wxejwa
@r_linux
Reddit From the linux community on Reddit Explore this post and more from the linux community
More from @r_linux
  1. Oct 5, 2026I hate GNU/Linux fragmentation. As the title says. I’m not talking about the many families…
  2. Oct 5, 2026Hot take: we actually don't need that much compute power https://preview.redd.it/0xjdag8q3…
  3. Oct 4, 2026I built a FOSS CLI that turns a network failure into a portable support snapshot https://r…
  4. Oct 4, 2026Rant against Ubuntu I had windows on my machine, but quite lately I was annoyed with windo…
  5. Oct 4, 2026FreeLinX base 1.3.1 Release https://redd.it/1wxqf9s @r_linux
  6. Oct 4, 2026Proposal To Set ARM64 Kernel Stack Size At Boot Time To Reduce Memory Consumption https://…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →