1

I'd like to have return pressed twice after I run a command to make the terminal easier to read.

[root@localhost ~]# fdisk -l /dev/sda1
Disk /dev/sda1: 1 GiB, 1073741824 bytes, 2097152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[root@localhost ~]# RETURN
[root@localhost ~]# RETURN
[root@localhost ~]# fdisk -l /dev/sda1
Disk /dev/sda1: 1 GiB, 1073741824 bytes, 2097152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[root@localhost ~]# RETURN
[root@localhost ~]# RETURN
[root@localhost ~]# NEW COMMAND

Is this possible?

1
  • Add a couple of \ns to the start of your PS1 environment variable: export PS1="\n\n$PS1".
    – DopeGhoti
    Commented Feb 19, 2019 at 19:41

1 Answer 1

3

Pressing return twice will do that, but that is not really what you want.

Try the following:

$ export PS1="\n\n$PS1"

If you want to do this for yourself, edit .profile in your homedirectory. If you want to do this system wide, put it in /etc/profile.

2
  • If I wanted to remove a newline from $PS1, what would I have to edit? I tried deleting one of the \n from the answer, but that just added another newline.
    – Ryan R
    Commented Feb 19, 2019 at 20:13
  • Never mind I figured it out. How would I make this change permanent? I'd like every shell session to include a \n in my PS1 variable.
    – Ryan R
    Commented Feb 19, 2019 at 20:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .