title: Linux adding filename and path to text file on a single line
body: <p>I'm trying to write a script to add the name of a file and the directory path to a text file on a single line.
  E.g.</p>
  
  <pre><code>Filename /root/folder/folder/
  </code></pre>
  
  <p>I've tried:</p>
  
  <pre><code>ls "$1" &gt;&gt; /root/folder/folder/file.txt
  pwd &gt;&gt; /root/folder/folder/file.txt
  </code></pre>
  
  <p>But it shows up on seperate lines.</p>
  
  <p>I did try</p>
  
  <pre><code>ls "$1" &amp;&amp; pwd &gt;&gt; ...... 
  </code></pre>
  
  <p>but it only pasted the pwd to the text file.</p>
  
  <p>I'm new to Linux so any help would be greatly appreciated.</p>