Update --linux
This commit is contained in:
parent
a8be4fe7a8
commit
a9c86852ad
1 changed files with 32 additions and 11 deletions
|
@ -109,17 +109,17 @@ Takes LOGFILE as an argument and prints its description."
|
||||||
(message "Unknown log file: %s" logfile))))
|
(message "Unknown log file: %s" logfile))))
|
||||||
|
|
||||||
(defvar linux-basic-commands-alist
|
(defvar linux-basic-commands-alist
|
||||||
'(("ls" . "List directory contents")
|
'(("list directory contents" . "ls")
|
||||||
("cd" . "Change directory")
|
("change directory" . "cd")
|
||||||
("mv" . "Move or rename files")
|
("move or rename files" . "mv")
|
||||||
("cp" . "Copy files")
|
("copy files" . "cp")
|
||||||
("rm" . "Remove files or directories")
|
("remove files or directories" . "rm")
|
||||||
("pwd" . "Print working directory")
|
("print working directory" . "pwd")
|
||||||
("echo" . "Display a line of text or a variable value")
|
("display variable value" . "echo")
|
||||||
("touch" . "Create an empty file or update the access/modification time of a file")
|
("create an empty file" . "touch")
|
||||||
("chmod" . "Change file permissions")
|
("change file permissions" . "chmod")
|
||||||
("chown" . "Change file ownership"))
|
("change file ownership" . "chown"))
|
||||||
"Alist mapping basic Linux commands to their descriptions.")
|
"Alist mapping basic Linux command descriptions to their commands.")
|
||||||
|
|
||||||
(defun describe-basic-linux-command (command)
|
(defun describe-basic-linux-command (command)
|
||||||
"Describe the purpose of a basic Linux command.
|
"Describe the purpose of a basic Linux command.
|
||||||
|
@ -171,3 +171,24 @@ Takes OPTION as an argument and prints its description."
|
||||||
(if description
|
(if description
|
||||||
(message "%s: %s" option description)
|
(message "%s: %s" option description)
|
||||||
(message "Unknown chmod option: %s" option))))
|
(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"))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue