#trouble understanding / and >

8 messages · Page 1 of 1 (latest)

visual plinth
#
cat $HOME/.config/i3/config.base \
    $HOME/.config/i3/config.local > $HOME/.config/i3/config

I am using i3 and from what I can tell this is the only way to import a seperate file, it seems like trickery (I love tricks). can anyone help me understand what each part is I know with cat $HOME/.../config.base we are reading the contents of the file. the rest allludes me.

#

trouble understanding / and <

#

trouble understanding / and >

pine oasis
#

The "\" is an escape character. In this case, it escapes the newline. You can safely remove it to put everything into one line without modfiying logic.

This is exactly the same:

cat $HOME/.config/i3/config.base $HOME/.config/i3/config.local > $HOME/.config/i3/config

#

cat accepts multiple arguments.

#

So here you are concatenating the contents of two files

#

Btw, the name cat comes from the word concatenate

#

The > is a redirection operator. You are redirecting stdout (standard out) to a file.

There is a distinction between > and >>

> overwrites the contents of the file. >> appends to the file.