read
Then press the desired key (example: F5)
^[[15~
Try
bind '"\e[15~"':"\"ssh su@ip-address\C-m"""
or
bind '"\e[16~"':"\"apachectl -k restart\C-m"""
F S UID PID PPID C PRI NI ADDR SZ WCHAN RSS PSR STIME TTY TIME CMD 4 S root 1 0 0 76 0 - 371 - 528 1 Jun02 ? 00:00:01 init [2] 1 S bind 31818 1 0 80 0 - 9274 rt_sig 2728 1 Jun02 ? 00:00:00 /usr/sbin/named -t /var/named/run-root -c /etc/named.conf -u bind 1 S clamav 32358 1 0 75 0 - 667 pause 1268 0 Jun02 ? 00:00:04 Filesystem Size Used Avail Use% Mounted on /dev/vzfs 30G 25G 5,1G 83% / tmpfs 4,0G 64K 4,0G 1% /var/run total used free shared buffers cached Mem: 8099 7657 441 0 198 4624 Swap: 16002 3 15998 Total: 24102 7661 16440 Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 27870/mysqld tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1499/apache2 tcp 0 0 0.0.0.0:8880 0.0.0.0:* LISTEN 1706/httpsd tcp 0 0 87.230.26.178:53 0.0.0.0:* LISTEN 31818/named tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 31818/named tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1825/sshd tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 31818/named tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 32482/0 tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 1499/apache2 tcp 0 0 0.0.0.0:8443 0.0.0.0:* LISTEN 1706/httpsd 2009-06-02 12:57 30316 id=si term=0 exit=0 system boot 2009-06-02 12:57 run-level 2 2009-06-02 12:57 last=S 2009-06-02 12:58 31781 id=l2 term=0 exit=0 root - pts/0 2009-06-22 01:01 . 32484 (p57a704d4.dip0.t-ipconnect.de) pts/1 2009-06-21 20:42 5497 id=ts/1 term=0 exit=0
Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?
You must be signed in to comment.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: