Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

-3 votes
0 answers
31 views
Kali Linux terminal shows overlapping or misplaced symbols
How can I change my Kali Linux terminal preference settings back to the default? Because the symbols are not in the right place, I think. As you can see, the symbols overlap with each other. [![Screenshot showing overlapping characters in the terminal][1]][1] [1]: https://i.sstatic.net/9Q2rQwBK.png
How can I change my Kali Linux terminal preference settings back to the default? Because the symbols are not in the right place, I think. As you can see, the symbols overlap with each other. Screenshot showing overlapping characters in the terminal
Subhan Ceferov (1 rep)
Jul 30, 2025, 02:27 PM • Last activity: Jul 31, 2025, 05:57 AM
2 votes
3 answers
5224 views
How to stop execution of command from prompt in shell?
My prompt contains some info about git repo under current directory. When I do `cd` somewhere, my shell executes some commands (i.e. `git status`). Is there a way to stop execution of such commands via the same terminal? Sending signals from keyboard (e.g. via Ctrl + c ) doesn't work. ### Update #1...
My prompt contains some info about git repo under current directory. When I do cd somewhere, my shell executes some commands (i.e. git status). Is there a way to stop execution of such commands via the same terminal? Sending signals from keyboard (e.g. via Ctrl+c) doesn't work. ### Update #1 I don't want to disable those commands permanently - I just want them to start running and then stop them in runtime.
abyss.7 (189 rep)
Jan 10, 2018, 01:32 PM • Last activity: Jul 22, 2025, 03:02 AM
7 votes
2 answers
4212 views
Difficult authorized_keys login problem only for root on Solaris 11
Here's a difficult ssh problem I can't figure out on Solaris 11, although I think I'm an experienced UNIX/Linux sysadmin. :) I've copied the `root@server1:/root/.ssh/id_rsa.pub` file to: root@server2:/root/.ssh/authorized_keys oracle@server2:/home/oracle/.ssh/authorized_keys No problem logging on or...
Here's a difficult ssh problem I can't figure out on Solaris 11, although I think I'm an experienced UNIX/Linux sysadmin. :) I've copied the root@server1:/root/.ssh/id_rsa.pub file to: root@server2:/root/.ssh/authorized_keys oracle@server2:/home/oracle/.ssh/authorized_keys No problem logging on or running commands remotely for oracle@server2. I keep getting the password prompt for root@server2. If I run "sshd -d" (debug mode) on server2 and run "ssh root@server2 uptime" from server1, I get to see the following info on server2 until I get the password prompt and press Ctrl-C to interrupt it: server2# /usr/lib/ssh/sshd -d debug1: sshd version Sun_SSH_2.2 debug1: key_load_private: loading /etc/ssh/ssh_host_rsa_key debug1: ssh_kmf_check_uri: /etc/ssh/ssh_host_rsa_key debug1: read PEM private key done: type RSA debug1: Private host key #0 of type 1 (RSA). debug1: key_load_private: loading /etc/ssh/ssh_host_dsa_key debug1: ssh_kmf_check_uri: /etc/ssh/ssh_host_dsa_key debug1: read PEM private key done: type DSA debug1: Private host key #1 of type 2 (DSA). debug1: Creating a global KMF session. debug1: Bind to port 22 on ::. Server listening on :: port 22. debug1: Server will not fork when running in debugging mode. Connection from 10.71.4.10 port 21911 debug1: Client protocol version 2.0; client software version Sun_SSH_2.2 debug1: match: Sun_SSH_2.2 pat Sun_SSH_2.* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-Sun_SSH_2.2 monitor debug1: list_hostkey_types: ssh-rsa,ssh-dss debug1: Reloading X.509 host keys to avoid PKCS#11 fork issues. monitor debug1: reading the context from the child debug1: use_engine is 'yes' debug1: pkcs11 engine initialized, now setting it as default for RSA, DSA, and symmetric ciphers debug1: pkcs11 engine initialization complete debug1: list_hostkey_types: ssh-rsa,ssh-dss debug1: My KEX proposal before adding the GSS KEX algorithm: debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: My KEX proposal I sent to the peer: debug1: KEX proposal I received from the peer: debug1: kex: client->server aes128-ctr hmac-sha2-256 none debug1: kex: server->client aes128-ctr hmac-sha2-256 none debug1: Host key algorithm 'ssh-rsa' chosen for the KEX. debug1: Peer sent proposed langtags, ctos: en-US debug1: Peer sent proposed langtags, stoc: en-US debug1: We proposed langtags, ctos: de-DE,en-US,es-ES,fr-FR,it-IT,ja-JP,ko-KR,pt-BR,zh-CN,zh-TW,i-default debug1: We proposed langtags, stoc: de-DE,en-US,es-ES,fr-FR,it-IT,ja-JP,ko-KR,pt-BR,zh-CN,zh-TW,i-default debug1: Negotiated main locale: en_US.UTF-8 debug1: Negotiated messages locale: en_US.UTF-8 debug1: Host key type is 1. debug1: SSH2_MSG_KEX_DH_GEX_REQUEST received debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent debug1: dh_gen_key: priv key bits set: 252/512 debug1: bits set: 2051/4095 debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT debug1: bits set: 2036/4095 debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent debug1: set_newkeys: setting new keys for 'out' mode debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: set_newkeys: setting new keys for 'in' mode debug1: SSH2_MSG_NEWKEYS received debug1: KEX done debug1: userauth-request for user root service ssh-connection method none debug1: attempt 0 initial attempt 0 failures 0 initial failures 0 Failed none for root from 10.71.4.10 port 21911 ssh2 debug1: userauth-request for user root service ssh-connection method publickey debug1: attempt 1 initial attempt 0 failures 0 initial failures 0 debug1: ssh_kmf_key_from_blob: blob length is 277. debug1: Test whether the public key is acceptable. debug1: temporarily_use_uid: 0/0 (e=0/0) debug1: trying public key file /root/.ssh/authorized_keys debug1: ssh_kmf_key_from_blob: blob length is 277. debug1: matching key found: file /root/.ssh/authorized_keys, line 1 Found matching RSA key: 8e:7f:c6:54:09:e7:fa:6e:5c:cc:c7:13:e2:13:90:22 debug1: restore_uid: 0/0 debug1: userauth-request for user root service ssh-connection method publickey debug1: attempt 2 initial attempt 0 failures 0 initial failures 0 debug1: ssh_kmf_key_from_blob: blob length is 277. debug1: We received a signature in the user auth packet. debug1: temporarily_use_uid: 0/0 (e=0/0) debug1: trying public key file /root/.ssh/authorized_keys debug1: ssh_kmf_key_from_blob: blob length is 277. debug1: matching key found: file /root/.ssh/authorized_keys, line 1 Found matching RSA key: 8e:7f:c6:54:09:e7:fa:6e:5c:cc:c7:13:e2:13:90:22 debug1: restore_uid: 0/0 debug1: ssh_rsa_verify: signature correct Failed publickey for root from 10.71.4.10 port 21911 ssh2 debug1: userauth-request for user root service ssh-connection method keyboard-interactive debug1: attempt 3 initial attempt 0 failures 2 initial failures 0 debug1: keyboard-interactive devs Connection closed by 10.71.4.10 debug1: Calling cleanup 0x2df78(0xec5010) debug1: Calling cleanup 0x262a8(0xece938) debug1: Calling cleanup 0x53590(0x0) monitor debug1: child closed the communication pipe before user auth was finished monitor debug1: Calling cleanup 0x53590(0x0) monitor debug1: Calling cleanup 0x53590(0x0) More information on the SSH server configuration: server2# diff /root/.ssh/authorized_keys /home/oracle/.ssh/authorized_keys server2# server2# ls -l /root/.ssh/authorized_keys /home/oracle/.ssh/authorized_keys -rw------- 1 oracle dba 396 Aug 29 08:53 /home/oracle/.ssh/authorized_keys -rw------- 1 root root 396 Aug 29 08:53 /root/.ssh/authorized_keys server2# ls -ld /root /home/oracle drwxr-xr-x 30 oracle dba 69 Aug 20 06:13 /home/oracle drwx------ 22 root root 43 Aug 29 08:52 /root server2# ls -ld /root/.ssh /home/oracle/.ssh drwx--x--x 2 root root 5 Mar 20 2014 /home/oracle/.ssh drwx--x--x 2 root root 3 Aug 29 08:53 /root/.ssh server2# grep Root /etc/ssh/sshd_config PermitRootLogin yes Below shows the remote server server2's /var/log/authlog when I attempted ssh root@server2 uptime from server1: Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: Forked child 13172. Aug 30 09:46:48 db01 sshd: [ID 800047 auth.info] Connection from 10.71.4.10 port 28154 Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: Client protocol version 2.0; client software version Sun_SSH_2.2 Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: match: Sun_SSH_2.2 pat Sun_SSH_2.* Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: Enabling compatibility mode for protocol 2.0 Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: Local version string SSH-2.0-Sun_SSH_2.2 Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] monitor debug1: list_hostkey_types: ssh-rsa,ssh-dss Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: Reloading X.509 host keys to avoid PKCS#11 fork issues. Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] monitor debug1: reading the context from the child Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: use_engine is 'yes' Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: pkcs11 engine initialized, now setting it as default for RSA, DSA, and symmetric ciphers Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: pkcs11 engine initialization complete Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: list_hostkey_types: ssh-rsa,ssh-dss Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: My KEX proposal before adding the GSS KEX algorithm: Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: SSH2_MSG_KEXINIT sent Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: SSH2_MSG_KEXINIT received Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: My KEX proposal I sent to the peer: Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: KEX proposal I received from the peer: Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: kex: client->server aes128-ctr hmac-sha2-256 none Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: kex: server->client aes128-ctr hmac-sha2-256 none Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: Host key algorithm 'ssh-rsa' chosen for the KEX. Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: Peer sent proposed langtags, ctos: en-US Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: Peer sent proposed langtags, stoc: en-US Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: We proposed langtags, ctos: de-DE,en-US,es-ES,fr-FR,it-IT,ja-JP,ko-KR,pt-BR,zh-CN,zh-TW,i-default Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: We proposed langtags, stoc: de-DE,en-US,es-ES,fr-FR,it-IT,ja-JP,ko-KR,pt-BR,zh-CN,zh-TW,i-default Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: Negotiated main locale: en_US.UTF-8 Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: Negotiated messages locale: en_US.UTF-8 Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: Host key type is 1. Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: SSH2_MSG_KEX_DH_GEX_REQUEST received Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: dh_gen_key: priv key bits set: 267/512 Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: bits set: 2056/4095 Aug 30 09:46:48 db01 sshd: [ID 800047 auth.debug] debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: bits set: 2053/4095 Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: set_newkeys: setting new keys for 'out' mode Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: SSH2_MSG_NEWKEYS sent Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: expecting SSH2_MSG_NEWKEYS Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: set_newkeys: setting new keys for 'in' mode Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: SSH2_MSG_NEWKEYS received Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: KEX done Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: userauth-request for user root service ssh-connection method none Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: attempt 0 initial attempt 0 failures 0 initial failures 0 Aug 30 09:46:49 db01 sshd: [ID 800047 auth.info] Failed none for root from 10.71.4.10 port 28154 ssh2 Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: userauth-request for user root service ssh-connection method publickey Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: attempt 1 initial attempt 0 failures 0 initial failures 0 Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: ssh_kmf_key_from_blob: blob length is 277. Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: Test whether the public key is acceptable. Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: temporarily_use_uid: 0/0 (e=0/0) Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: trying public key file /root/.ssh/authorized_keys Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: ssh_kmf_key_from_blob: blob length is 277. Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: matching key found: file /root/.ssh/authorized_keys, line 1 Aug 30 09:46:49 db01 sshd: [ID 800047 auth.info] Found matching RSA key: 8e:7f:c6:54:09:e7:fa:6e:5c:cc:c7:13:e2:13:90:22 Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: restore_uid: 0/0 Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: userauth-request for user root service ssh-connection method publickey Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: attempt 2 initial attempt 0 failures 0 initial failures 0 Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: ssh_kmf_key_from_blob: blob length is 277. Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: We received a signature in the user auth packet. Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: temporarily_use_uid: 0/0 (e=0/0) Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: trying public key file /root/.ssh/authorized_keys Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: ssh_kmf_key_from_blob: blob length is 277. Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: matching key found: file /root/.ssh/authorized_keys, line 1 Aug 30 09:46:49 db01 sshd: [ID 800047 auth.info] Found matching RSA key: 8e:7f:c6:54:09:e7:fa:6e:5c:cc:c7:13:e2:13:90:22 Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: restore_uid: 0/0 Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: ssh_rsa_verify: signature correct Aug 30 09:46:49 db01 sshd: [ID 800047 auth.notice] Failed publickey for root from 10.71.4.10 port 28154 ssh2 Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: userauth-request for user root service ssh-connection method keyboard-interactive Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: attempt 3 initial attempt 0 failures 2 initial failures 0 Aug 30 09:46:49 db01 sshd: [ID 800047 auth.debug] debug1: keyboard-interactive devs Aug 30 09:46:51 db01 sshd: [ID 800047 auth.info] Connection closed by 10.71.4.10 Aug 30 09:46:51 db01 sshd: [ID 800047 auth.debug] debug1: Calling cleanup 0x2df78(0x34f960) Aug 30 09:46:51 db01 sshd: [ID 800047 auth.debug] debug1: Calling cleanup 0x262a8(0x3592f8) Aug 30 09:46:51 db01 sshd: [ID 800047 auth.debug] debug1: Calling cleanup 0x53590(0x0) Aug 30 09:46:51 db01 sshd: [ID 800047 auth.debug] monitor debug1: child closed the communication pipe before user auth was finished Aug 30 09:46:51 db01 sshd: [ID 800047 auth.debug] monitor debug1: Calling cleanup 0x53590(0x0) Aug 30 09:46:51 db01 last message repeated 1 time Also, below shows the output on server1 (on the originating server) when I used "ssh -v -v -v root@server2" from server1 to connect to server2: server1# ssh -v -v -v root@server2 Sun_SSH_2.2, SSH protocols 1.5/2.0, OpenSSL 0x1000110f debug1: Reading configuration data /etc/ssh/ssh_config debug1: Rhosts Authentication disabled, originating port will not be trusted. debug1: ssh_connect: needpriv 0 debug1: Connecting to db01 [10.65.4.139] port 22. debug1: Connection established. debug1: ssh_kmf_check_uri: /root/.ssh/identity debug1: Identity file/URI '/root/.ssh/identity' pubkey type UNKNOWN debug1: ssh_kmf_check_uri: /root/.ssh/id_rsa debug3: Not a RSA1 key file /root/.ssh/id_rsa. debug2: key_type_from_name: unknown key type '-----BEGIN' debug3: key_read: no key found debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug3: key_read: no space debug2: key_type_from_name: unknown key type '-----END' debug3: key_read: no key found debug1: ssh_kmf_key_from_blob: blob length is 277. debug1: Identity file/URI '/root/.ssh/id_rsa' pubkey type ssh-rsa debug1: ssh_kmf_check_uri: /root/.ssh/id_dsa debug1: Identity file/URI '/root/.ssh/id_dsa' pubkey type UNKNOWN debug1: Logging to host: db01 debug1: Local user: root Remote user: root debug1: Remote protocol version 2.0, remote software version Sun_SSH_2.2 debug1: match: Sun_SSH_2.2 pat Sun_SSH_2.* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-Sun_SSH_2.2 debug1: use_engine is 'yes' debug1: pkcs11 engine initialized, now setting it as default for RSA, DSA, and symmetric ciphers debug1: pkcs11 engine initialization complete debug1: Creating a global KMF session. debug1: My KEX proposal before adding the GSS KEX algorithm: debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,x509v3-sign-rsa,x509v3-sign-dss debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour128,arcfour256,arcfour,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,3des-cbc debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour128,arcfour256,arcfour,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,3des-cbc debug2: kex_parse_kexinit: hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-sha2-256-96,hmac-sha2-512-96,hmac-sha1-96,hmac-md5,hmac-md5-96 debug2: kex_parse_kexinit: hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-sha2-256-96,hmac-sha2-512-96,hmac-sha1-96,hmac-md5,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib debug2: kex_parse_kexinit: none,zlib debug2: kex_parse_kexinit: en-US debug2: kex_parse_kexinit: en-US debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug1: Failed to acquire GSS-API credentials for any mechanisms (No credentials were supplied, or the credentials were unavailable or inaccessible ) debug1: SSH2_MSG_KEXINIT sent debug3: kex_reset_dispatch -- should we dispatch_set(KEXINIT) here? 0 && !0 debug1: SSH2_MSG_KEXINIT received debug1: My KEX proposal I sent to the peer: debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,x509v3-sign-rsa,x509v3-sign-dss debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour128,arcfour256,arcfour,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,3des-cbc debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour128,arcfour256,arcfour,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,3des-cbc debug2: kex_parse_kexinit: hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-sha2-256-96,hmac-sha2-512-96,hmac-sha1-96,hmac-md5,hmac-md5-96 debug2: kex_parse_kexinit: hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-sha2-256-96,hmac-sha2-512-96,hmac-sha1-96,hmac-md5,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib debug2: kex_parse_kexinit: none,zlib debug2: kex_parse_kexinit: en-US debug2: kex_parse_kexinit: en-US debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug1: KEX proposal I received from the peer: debug2: kex_parse_kexinit: gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g==,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour128,arcfour256,arcfour debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour128,arcfour256,arcfour debug2: kex_parse_kexinit: hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-sha2-256-96,hmac-sha2-512-96,hmac-sha1-96,hmac-md5,hmac-md5-96 debug2: kex_parse_kexinit: hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-sha2-256-96,hmac-sha2-512-96,hmac-sha1-96,hmac-md5,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib debug2: kex_parse_kexinit: none,zlib debug2: kex_parse_kexinit: de-DE,en-US,es-ES,fr-FR,it-IT,ja-JP,ko-KR,pt-BR,zh-CN,zh-TW,i-default debug2: kex_parse_kexinit: de-DE,en-US,es-ES,fr-FR,it-IT,ja-JP,ko-KR,pt-BR,zh-CN,zh-TW,i-default debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: mac_setup: found hmac-sha2-256 debug1: kex: server->client aes128-ctr hmac-sha2-256 none debug2: mac_setup: found hmac-sha2-256 debug1: kex: client->server aes128-ctr hmac-sha2-256 none debug1: Host key algorithm 'ssh-rsa' chosen for the KEX. debug1: Peer sent proposed langtags, ctos: de-DE,en-US,es-ES,fr-FR,it-IT,ja-JP,ko-KR,pt-BR,zh-CN,zh-TW,i-default debug1: Peer sent proposed langtags, stoc: de-DE,en-US,es-ES,fr-FR,it-IT,ja-JP,ko-KR,pt-BR,zh-CN,zh-TW,i-default debug1: We proposed langtags, ctos: en-US debug1: We proposed langtags, stoc: en-US debug1: Negotiated lang: en-US debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug1: Remote: Negotiated main locale: en_US.UTF-8 debug1: Remote: Negotiated messages locale: en_US.UTF-8 debug1: dh_gen_key: priv key bits set: 262/512 debug1: bits set: 2025/4095 debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug1: ssh_kmf_key_from_blob: blob length is 277. debug3: check_host_in_hostfile: filename /root/.ssh/known_hosts debug1: ssh_kmf_key_from_blob: blob length is 277. debug3: check_host_in_hostfile: match line 17 debug3: check_host_in_hostfile: filename /root/.ssh/known_hosts debug1: ssh_kmf_key_from_blob: blob length is 277. debug3: check_host_in_hostfile: match line 17 debug1: Host 'db01' is known and matches the RSA host key. debug1: Found key in /root/.ssh/known_hosts:17 debug1: bits set: 2075/4095 debug1: ssh_rsa_verify: signature correct debug2: kex_derive_keys debug3: kex_reset_dispatch -- should we dispatch_set(KEXINIT) here? 0 && !0 debug2: set_newkeys: mode 1 debug1: set_newkeys: setting new keys for 'out' mode debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug2: set_newkeys: mode 0 debug1: set_newkeys: setting new keys for 'in' mode debug1: SSH2_MSG_NEWKEYS received debug1: done: ssh_kex2. debug1: send SSH2_MSG_SERVICE_REQUEST debug2: service_accept: ssh-userauth debug1: got SSH2_MSG_SERVICE_ACCEPT debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive debug3: start over, passed a different list gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password debug3: authmethod_lookup gssapi-keyex debug3: remaining preferred: gssapi-with-mic,publickey,keyboard-interactive,password debug3: authmethod_is_enabled gssapi-keyex debug1: Next authentication method: gssapi-keyex debug2: we did not send a packet, disable method debug3: authmethod_lookup gssapi-with-mic debug3: remaining preferred: publickey,keyboard-interactive,password debug3: authmethod_is_enabled gssapi-with-mic debug1: Next authentication method: gssapi-with-mic debug1: Failed to acquire GSS-API credentials for any mechanisms (No credentials were supplied, or the credentials were unavailable or inaccessible ) debug2: we did not send a packet, disable method debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Trying private key: /root/.ssh/identity debug1: ssh_kmf_check_uri: /root/.ssh/identity debug3: no such identity: /root/.ssh/identity debug1: Trying public key: /root/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Server accepts key: pkalg ssh-rsa blen 277 lastkey 73cee8 hint 1 debug3: Pubkey type from SSH_MSG_USERAUTH_PK_OK is ssh-rsa. debug1: ssh_kmf_key_from_blob: blob length is 277. debug2: input_userauth_pk_ok: fp 8e:7f:c6:54:09:e7:fa:6e:5c:cc:c7:13:e2:13:90:22 debug3: sign_and_send_pubkey debug1: ssh_kmf_check_uri: /root/.ssh/id_rsa debug1: read PEM private key done: type RSA debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive debug1: Trying private key: /root/.ssh/id_dsa debug1: ssh_kmf_check_uri: /root/.ssh/id_dsa debug3: no such identity: /root/.ssh/id_dsa debug2: we did not send a packet, disable method debug3: authmethod_lookup keyboard-interactive debug3: remaining preferred: password debug3: authmethod_is_enabled keyboard-interactive debug1: Next authentication method: keyboard-interactive debug2: userauth_kbdint debug2: we sent a keyboard-interactive packet, wait for reply debug2: input_userauth_info_req debug2: input_userauth_info_req: num_prompts 1 Password: debug3: packet_send2: adding 32 (len 14 padlen 18 extra_pad 64) Connection closed by 10.65.4.139 debug1: Calling cleanup 0x418a8(0x0)
Steve (171 rep)
Aug 29, 2016, 04:30 PM • Last activity: Jul 14, 2025, 09:04 AM
327 votes
25 answers
1062963 views
Colorizing your terminal and shell environment?
I spend most of my time working in Unix environments and using terminal emulators. I try to use color on the command line, because color makes the output more useful and intuitive. What options exist to add color to my terminal environment? What tricks do you use? What pitfalls have you encountered?...
I spend most of my time working in Unix environments and using terminal emulators. I try to use color on the command line, because color makes the output more useful and intuitive. What options exist to add color to my terminal environment? What tricks do you use? What pitfalls have you encountered? Unfortunately, support for color varies depending on terminal type, OS, TERM setting, utility, buggy implementations, etc. Here are some tips from my setup, after a lot of experimentation: 1. I tend to set TERM=xterm-color, which is supported on most hosts (but not all). 2. I work on a number of different hosts, different OS versions, etc. I use everything from macOS X, Ubuntu Linux, RHEL/CentOS/Scientific Linux and FreeBSD. I'm trying to keep things simple and generic, if possible. 3. I do a bunch of work using GNU screen, which adds another layer of fun. 3. Many OSs set things like dircolors and by default, and I don't want to modify this on a hundred different hosts. So I try to stick with the defaults. Instead, I tweak my terminal's color configuration. 4. Use color for some Unix commands (ls, grep, less, vim) and the Bash prompt . These commands seem to use the standard "ANSI escape sequences ". For example: alias less='less --RAW-CONTROL-CHARS' export LS_OPTS='--color=auto' alias ls='ls ${LS_OPTS}' I'll post my .bashrc and answer my own question Jeopardy Style.
Stefan Lasiewski (20733 rep)
Aug 10, 2010, 09:21 PM • Last activity: Jul 10, 2025, 05:23 PM
5 votes
4 answers
4935 views
change prompt formatting based on cwd
I use tcsh. I'd like to have my prompt formatting (coloring/highlighting) change based on the directory I'm in, or other critical aspects of my environment. I'm not enough of a shell hacker to know how to do this. Ownership of Current Directory ------------------------------ If I'm in one of "my" di...
I use tcsh. I'd like to have my prompt formatting (coloring/highlighting) change based on the directory I'm in, or other critical aspects of my environment. I'm not enough of a shell hacker to know how to do this. Ownership of Current Directory ------------------------------ If I'm in one of "my" directories (i.e., I am owner of the current working directory), then it should have normal appearance. But if I'm in someone else's directory (I do a lot of support and cd to others' working areas), then I want the prompt to look clearly different. This is to remind me to not type impolite commands in others' directories. (think make clobber or p4 sync, etc.) Critical Environment Variable Setting ------------------------------------- Another important piece of information for my environment is whether a certain environment variable is set, call it SWDEV. If SWDEV is not set, then my scripts and flows come from their default location. But if this variable is set, then it's taken as a new root location for my scripts and flows, with behaviors changing according to the scripts at that location. It's important to be reminded of the setting of this variable, lest I expect "normal" behavior but instead absentmindedly run code from the new location.
Winston Smith (838 rep)
May 15, 2013, 12:08 AM • Last activity: May 26, 2025, 02:09 PM
2 votes
2 answers
2336 views
My bash prompt is not working in `screen`
On RedHat, `screen` resets my bash prompt. I set `PS1=\u@\h:\w` in `~/.bashrc` and `~/.bash_profile`. I added `shell -$SHELL` as well to ` ~/.screenrc`. But, when I open a brand new terminal window, the prompt is correct, except in `screen`. In `screen` I always get this prompt format: `\u@\h>` How...
On RedHat, screen resets my bash prompt. I set PS1=\u@\h:\w in ~/.bashrc and ~/.bash_profile. I added shell -$SHELL as well to ~/.screenrc. But, when I open a brand new terminal window, the prompt is correct, except in screen. In screen I always get this prompt format: \u@\h> How can I set the same prompt in screen?
user2013619 (375 rep)
Sep 12, 2013, 08:21 AM • Last activity: May 15, 2025, 07:01 PM
1 votes
1 answers
117 views
Multiline command substitution - syntax errors with mysterious `+1`
I'm trying to break a long command substitution on to multiple lines, as discussed in [this answer](https://unix.stackexchange.com/a/82183/128023). In a plain command pipeline, both explicit (`\`) and implicit line continuation work fine: ```shell $ echo 'blah foo bar' \ > | grep -F 'blah' blah foo...
I'm trying to break a long command substitution on to multiple lines, as discussed in [this answer](https://unix.stackexchange.com/a/82183/128023) . In a plain command pipeline, both explicit (\) and implicit line continuation work fine:
$ echo 'blah foo bar' \
> | grep -F 'blah'
blah foo bar

$ echo 'blah foo bar' |
> grep -F 'blah'
blah foo bar
Inside of a command substitution, they both fail, and slightly differently:
$ foo=$(echo 'blah foo bar' \
> | grep -F 'blah')
-bash: 4131
| grep -F 'blah') +1 : syntax error: invalid arithmetic operator (error token is "'blah') +1 ")

$ foo=$(echo 'blah foo bar' |
> grep -F 'blah')
-bash: 4133
grep -F 'blah') +1 : syntax error in expression (error token is "grep -F 'blah') +1 ")
I'm on bash 5.2.21 and .37. I'm testing at the command prompt, but my real use case is this in .bashrc:
SSH_AUTH_SOCK="$(\ls -l /tmp/ssh-*/agent.* 2> /dev/null | grep -F "$USER" | head -1 | awk '{print $NF}')"
What's happening? Where did the +1 come from? And is there a way to do this correctly? (I'm interested in portable solutions or bash-specific.) ### Edit: More context I'm using [Oh My Posh] and [Atuin] with [bash-preexec], all of which do something at prompt time. My example actually looks like this: Screenshot of example showing fancy prompt They're set up in .bashrc like so:
eval "$(oh-my-posh init bash --config "${omp_config}")"                                                                                                                                                          # Get bash history number:
set_poshcontext () { export _myhistcmd=$(( $(fc -l -1 | cut -f1) +1 )); }
#                                                 Note the +1! ^^

[ -r "${HOMEBREW_PREFIX}/etc/profile.d/bash-preexec.sh" ] && . "${HOMEBREW_PREFIX}/etc/profile.d/bash-preexec.sh"
eval "$(atuin init bash --disable-up-arrow)"
To @Stéphane Chazelas questions:
$ typeset -p PS{1..4}
declare -- PS1="\$(_omp_get_primary)"
declare -- PS2="\$(_omp_get_secondary)"
-bash: typeset: PS3: not found
declare -- PS4="+ "

$ echo "$PROMPT_COMMAND"
__bp_precmd_invoke_cmd
_omp_hook
__bp_interactive_mode

$ trap
trap -- '__bp_preexec_invoke_exec "$_"' DEBUG
Jacktose (533 rep)
Apr 30, 2025, 11:58 PM • Last activity: May 2, 2025, 05:58 PM
3 votes
2 answers
3398 views
Display git branch in terminal
I am using fedora OS and I want to display git branch or tag in terminal when I go into the git folder project. I follow [this tutorial](https://fedoraproject.org/wiki/Git_quick_reference#Display_current_branch_in_bash). After I ran: source /usr/share/git-core/contrib/completion/git-prompt.sh source...
I am using fedora OS and I want to display git branch or tag in terminal when I go into the git folder project. I follow [this tutorial](https://fedoraproject.org/wiki/Git_quick_reference#Display_current_branch_in_bash) . After I ran: source /usr/share/git-core/contrib/completion/git-prompt.sh source ~/.bashrc It displays the git branch well. But if I run: cd .. #I go back the parent folder which is not git folder It keeps the git branch. How can I fix it?
GAVD (181 rep)
Mar 18, 2018, 05:32 PM • Last activity: Apr 30, 2025, 03:07 PM
0 votes
2 answers
51 views
How to improve responsiveness of git hash in zsh prompt?
I wanted to put the current git hash in my prompt; but my initial approach was kind of laggy: ```zsh psvar[1]="$(git log -n1 --pretty='format: %h' 2>/dev/null)" ``` (with `$PROMPT` including `%1v` to make that visible) I tried the `vcs_info` plugin, but that was also laggy. So I've ended up writing...
I wanted to put the current git hash in my prompt; but my initial approach was kind of laggy:
psvar="$(git log -n1 --pretty='format: %h' 2>/dev/null)"
(with $PROMPT including %1v to make that visible) I tried the vcs_info plugin, but that was also laggy. So I've ended up writing my own function:
function githead() {
  local commondir ref hash _
  local gitdir="${1:a}"
  until [[ -e "$gitdir/.git" ]]; do
    local updir="${gitdir%/*}"
    [[ "$updir" == "$gitdir" ]] && return 1
    gitdir="$updir"
  done
  gitdir="$gitdir/.git"
  [[ -f "$gitdir" ]] && read _ gitdir < "$gitdir"
  read _ ref < "$gitdir/HEAD"
  local commondir="$gitdir/commondir"
  [[ -e "$commondir" ]] && gitdir="$gitdir/$(<$commondir)"
  ref="$gitdir/$ref"
  read hash <"$ref"
  print -r "${hash::12}"
  return 0
}
It's certainly faster, but that's _bound_ to be brittle. In particular, a couple of the files I have to read look like they _could_ contain more than one line of content, and not necessarily put the line I want at the top. Is there a fast way of getting the current hash from git, which is more robust than what I've written by hand?
sh1 (113 rep)
Mar 7, 2025, 06:19 AM • Last activity: Mar 12, 2025, 04:51 AM
0 votes
2 answers
82 views
time in bash prompt does not change over time
I changed the prompt in my .bashrc to show the current time. This was the original prompt (from a fresh MX Linux install) ``` PS1="$PURPLE\u$nc@$CYAN\H$nc:$GREEN\w$nc\\n$GREEN\$$nc " ``` and I changed it to this ``` PS1="$PURPLE\u$nc@$CYAN\H$nc $YELLOW$(date '+%Y-%m-%d %H:%M:%S')$nc $REEN\w$nc\\n$GR...
I changed the prompt in my .bashrc to show the current time. This was the original prompt (from a fresh MX Linux install)
PS1="$PURPLE\u$nc@$CYAN\H$nc:$GREEN\w$nc\\n$GREEN\$$nc "
and I changed it to this
PS1="$PURPLE\u$nc@$CYAN\H$nc $YELLOW$(date '+%Y-%m-%d %H:%M:%S')$nc $REEN\w$nc\\n$GREEN\$$nc "
When I open a terminal, I see the current date and time in the prompt. New prompts are not displayed with the time at which they are generated. They always show the same time as the first prompt. What am I doing wrong? enter image description here
crantok (124 rep)
Mar 6, 2025, 12:32 PM • Last activity: Mar 6, 2025, 06:18 PM
1 votes
2 answers
91 views
How can I make my shell prompt show the working directory relative to an arbitrary directory?
Suppose I do a lot of work under the directory `/home/user/documents/foo`, so the Bash shell prompt could appear as follows: ``` user@hostname: ~/documents/foo/bar/baz $ ``` My terminal is quite narrow, and the `~/documents/foo` is not a helpful use of space, since I already know I am there. I would...
Suppose I do a lot of work under the directory /home/user/documents/foo, so the Bash shell prompt could appear as follows:
user@hostname: ~/documents/foo/bar/baz $
My terminal is quite narrow, and the ~/documents/foo is not a helpful use of space, since I already know I am there. I would therefore like my shell prompt to show the working directory *relative to* /home/user/documents/foo:
user@hostname: bar/baz $
The prompt is defined by the PS1 environment variable, and I can find ways of editing this to include the path relative to my user's home directory, or to include only the basename, but I can't seem to get a path relative to a different directory.
pythonmegapixel (13 rep)
Mar 4, 2025, 09:14 AM • Last activity: Mar 4, 2025, 03:21 PM
8 votes
3 answers
2586 views
zsh prompt: check whether inside git repository and not being ignored by git
In my `zsh` shell, I am dynamically changing prompt depending on whether I am inside `git` repository or not. I am using following git command to check: if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then ... now I also want to distinguish whether current directory is being ignored by `g...
In my zsh shell, I am dynamically changing prompt depending on whether I am inside git repository or not. I am using following git command to check: if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then ... now I also want to distinguish whether current directory is being ignored by git. So I have added one more check to my if statement: if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1) && ! $(git check-ignore . >/dev/null 2>&1); then ... This works fine, but I was wondering whether I could simplify this into one git command. Since the prompt is refreshed on every ENTER, it tends to slow down the shell noticeably on some slower machines. UPDATE ====== The accepted solution from @Stephen Kitt works great, except in following situation: I am using repository across filesystems. Lets say git resides at /.git (because I want to track my config files in /etc), but I also want to track some files in /var/foo, which is a different partition/filesystem. When I am located at / and execute following command, everything works as expected, and I get return code 1 (because /var/foo is being tracked): # git check-ignore -q /var/foo But when I am located anywhere in /var, the same command fails with error code 128 and following error message: # git check-ignore -q /var/foo fatal: not a git repository (or any parent up to mount point /) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). But I think this is only problem with the check-ignore command. Otherwise git seems to work fine across filesystem. I can track files in /var/foo fine. The expected behavior should be that git check-ignore -q /var/foo returns 1, and git check-ignore -q /var/bar returns 0, if it is not being tracked. **how can I fix this problem?**
Martin Vegter (586 rep)
Jan 4, 2021, 06:10 AM • Last activity: Feb 19, 2025, 11:40 PM
0 votes
0 answers
59 views
PS1: tab completion or line break leads to cursor shift
I recently changed my `PS1` in my `.bashrc` and I notice that my prompt has problems when the command line has more characters typed into than the number of columns of my terminal window. I also recognised that I cannot use ^R (search for commands in the history) properly: the cursor seems to be shi...
I recently changed my PS1 in my .bashrc and I notice that my prompt has problems when the command line has more characters typed into than the number of columns of my terminal window. I also recognised that I cannot use ^R (search for commands in the history) properly: the cursor seems to be shifted by several tabstops in both cases. I'm quite sure that this comes from my new PS1, but I couldn't spot where' exactly the mistake. If I knew how to insert a line break into my PS1, I'd be very happy. My definition of PS1 in my .bashrc:
PS1='\[\033[1;37m\]$? $(if [[ $? == 0 ]]; then echo "\[\033[01;32m\]\342\234\223"; else echo "\[\033[01;31m\]\342\234\227"; fi) \# \[\033[1;32m\]\u\[\033[31m\]@\[\033[1;35m\]\H\[\033[1;33m\]:\e[47m\[\033[1;34m\]\w\[\033[0m\]\$\[\033[0m\] '
muggi (759 rep)
Jan 14, 2025, 03:44 PM
6 votes
1 answers
4658 views
How to set shell to wrap words for long commands?
I connect to a Slackware server. When a command is longer than the size of the putty window, the line continues in the same line, and the start of the command disappears as I continue adding to the same command, just putting a "<" at the beginning of the line. [![slackwareserver][1]][1] When I work...
I connect to a Slackware server. When a command is longer than the size of the putty window, the line continues in the same line, and the start of the command disappears as I continue adding to the same command, just putting a "<" at the beginning of the line. slackwareserver When I work on the Red Hat server, I can see the whole command because the console just adds lines as it needs. RedHatServer I don't know where I turn on word wrapping. Where can I set the Slackware server to wrap words as my Red Hat server does? P.S.: Excuse my English.
user358308 (63 rep)
Jun 17, 2019, 06:01 PM • Last activity: Dec 30, 2024, 12:52 PM
0 votes
1 answers
52 views
Stop bind -x command output from overwriting current prompt string
I have the following two bash aliases defined in `.bash_aliases`: # Better ls -al bind -x '"\el":"command ls -lAtr"' # Show newest 10 files in a folder bind -x '"\eh":"command ls -1U | head"' Now when I hit Alt + h or Alt + l to invoke the command, the command output overwrites the last shell prompt...
I have the following two bash aliases defined in .bash_aliases: # Better ls -al bind -x '"\el":"command ls -lAtr"' # Show newest 10 files in a folder bind -x '"\eh":"command ls -1U | head"' Now when I hit Alt+h or Alt+l to invoke the command, the command output overwrites the last shell prompt. This makes it hard to find where an ls starts and ends (if invoked multiple times). How can I stop it from doing that?
glades (117 rep)
Dec 20, 2024, 02:26 PM • Last activity: Dec 23, 2024, 09:39 PM
0 votes
1 answers
169 views
debian command line keeps adding newline
Sorry if this is an easy one, I've tried searching and it's started to annoy me now. On one of my (Debian) servers the command prompt insists on adding a new line every time. So it looks like this: name@servername ~/directory % how can I get rid if the newline after the directory name, so that I am...
Sorry if this is an easy one, I've tried searching and it's started to annoy me now. On one of my (Debian) servers the command prompt insists on adding a new line every time. So it looks like this: name@servername ~/directory % how can I get rid if the newline after the directory name, so that I am typing on the same line as name@servername ~/directory and not underneath it. There is no .bashrc file that I can find, and this is the only server that does it. Where else could this be controlled from? --- echo $SHELL:
/bin/zsh
echo $PS1:
%K{blue}%n@%m%k %B%F{cyan}%(4~|...|)%3~%F{white} %# %b%f%k
(probably explains why .bashrc doesn't exist)
IGGt (2547 rep)
Dec 20, 2024, 11:58 AM • Last activity: Dec 23, 2024, 04:40 PM
34 votes
7 answers
58450 views
oh-my-zsh's prompt is slow: how to fix this
I'm using macOS 10.15.2 with iTerm2, zsh 5.7.1 and oh-my-zsh (theme robbyrussell). I noticed that the prompt print is slightly slow respect to the bash one. For example, if I press enter , cursor initially goes at the beginning of the next line then, after a little while, the shell prompt comes in a...
I'm using macOS 10.15.2 with iTerm2, zsh 5.7.1 and oh-my-zsh (theme robbyrussell). I noticed that the prompt print is slightly slow respect to the bash one. For example, if I press enter, cursor initially goes at the beginning of the next line then, after a little while, the shell prompt comes in and the cursor is moved to its natural position. For example, if → ~ is the prompt when I'm in my home folder, and [] is my cursor, when I press enter I see: **0 - Idle status** → ~ [] **1 - Immediately after pressing enter** [] **2 - Back to idle status** → ~ [] This slowness is particularly evident when I quickly press enter multiple times. In this case, I see some blank lines. This is what I see → ~ → ~ → ~ → ~ → ~ → ~ → ~ → ~ → ~ [] I come from bash shell and when I use bash, there is not such a slowness. I'm not sure this is an issue of oh-my-zsh or its natural behavior. I'd like to know more about this and, eventually, how to fix it. Thanks. **PS**: the problem comes from oh-my-zsh and it persists even if I disable all the plugins. **PPS**: I previously posted this question on SO. Thanks to user1934428 for his help and for suggesting me to move this question here.
floatingpurr (485 rep)
Feb 5, 2020, 01:07 PM • Last activity: Dec 7, 2024, 02:23 AM
75 votes
8 answers
225961 views
How can I change my bash prompt to show my working directory?
I can print my current working dir like this myPrompt$ pwd /Users/me/myDir I want my shell to look like this /Users/me/myDir$ pwd /Users/me/myDir Is that possible? How can I do it?
I can print my current working dir like this myPrompt$ pwd /Users/me/myDir I want my shell to look like this /Users/me/myDir$ pwd /Users/me/myDir Is that possible? How can I do it?
bernie2436 (6855 rep)
Nov 13, 2013, 12:47 AM • Last activity: Nov 27, 2024, 09:24 PM
0 votes
1 answers
91 views
How to replicate the Zsh command line prompt from the archlinux boot USB stick
It looks very nice and useful. Is there a theme I can download to install it quickly?
It looks very nice and useful. Is there a theme I can download to install it quickly?
aleb (388 rep)
Oct 21, 2024, 01:51 PM
221 votes
9 answers
313751 views
What color codes can I use in my Bash PS1 prompt?
I used several colors in my bash PS1 prompt such as: \033]01;31\] # pink \033]00m\] # white \033]01;36\] # bold green \033]02;36\] # green \033]01;34\] # blue \033]01;33\] # bold yellow Where can I find a list of the color codes I can use? I looked at https://unix.stackexchange.com/questions/74024/c...
I used several colors in my bash PS1 prompt such as: \033]01;31\] # pink \033]00m\] # white \033]01;36\] # bold green \033]02;36\] # green \033]01;34\] # blue \033]01;33\] # bold yellow Where can I find a list of the color codes I can use? I looked at https://unix.stackexchange.com/questions/74024/colorize-bash-console-color but it didn't answer my question about a list of the actual codes. It would be nice if there was a more readable form also. See also: [How can I get my PS1 prompt to show time, user, host, directories, and Git branch](https://unix.stackexchange.com/a/127800/10043)
Michael Durrant (43563 rep)
Apr 12, 2014, 03:38 PM • Last activity: Oct 15, 2024, 03:51 PM
Showing page 1 of 20 total questions