Update --linux

This commit is contained in:
Marcus Kammer 2023-09-10 11:25:03 +02:00
parent a8be4fe7a8
commit a9c86852ad
Signed by: marcuskammer
GPG key ID: C374817BE285268F

View file

@ -109,17 +109,17 @@ Takes LOGFILE as an argument and prints its description."
(message "Unknown log file: %s" logfile))))
(defvar linux-basic-commands-alist
'(("ls" . "List directory contents")
("cd" . "Change directory")
("mv" . "Move or rename files")
("cp" . "Copy files")
("rm" . "Remove files or directories")
("pwd" . "Print working directory")
("echo" . "Display a line of text or a variable value")
("touch" . "Create an empty file or update the access/modification time of a file")
("chmod" . "Change file permissions")
("chown" . "Change file ownership"))
"Alist mapping basic Linux commands to their descriptions.")
'(("list directory contents" . "ls")
("change directory" . "cd")
("move or rename files" . "mv")
("copy files" . "cp")
("remove files or directories" . "rm")
("print working directory" . "pwd")
("display variable value" . "echo")
("create an empty file" . "touch")
("change file permissions" . "chmod")
("change file ownership" . "chown"))
"Alist mapping basic Linux command descriptions to their commands.")
(defun describe-basic-linux-command (command)
"Describe the purpose of a basic Linux command.
@ -171,3 +171,24 @@ Takes OPTION as an argument and prints its description."
(if description
(message "%s: %s" option description)
(message "Unknown chmod option: %s" option))))
(defvar ssh-use-cases-alist
'(("remote login" . "ssh user@host")
("run command" . "ssh user@host 'command'")
("file transfer" . "scp file.txt user@host:/path/")
("secure ftp" . "sftp user@host")
("port forwarding" . "ssh -L local_port:remote_host:remote_port user@host")
("dynamic port forwarding" . "ssh -D port user@host")
("remote port forwarding" . "ssh -R remote_port:local_host:local_port user@host")
("tunneling" . "ssh -L local_port:remote_host:remote_port user@host -f -N")
("agent forwarding" . "ssh -A user@host")
("ssh multiplexing" . "ssh -M -S /tmp/ssh_socket user@host; ssh -S /tmp/ssh_socket user@host"))
"Alist mapping SSH use cases to their corresponding commands.")
(defun describe-ssh-use-case (use-case)
"Describe the SSH command for a given use case."
(interactive "sEnter the SSH use case: ")
(let ((command (assoc-default use-case ssh-use-cases-alist)))
(if command
(message "Command for %s: %s" use-case command)
(message "Use case not found"))))