# Important Linux Command Tricks

1. **cat : concatenate**
    
    **cat &gt; amit.js**
    
    would create new file, ❗❗ BUT, if same file then rewrite.
    
    **cat &gt;&gt; amit.js**
    
    will give prompt to write something new, and will append to current file.
    
    Note: ❗❗❗
    
    \&gt; : means rewrite
    
    \&gt;&gt; : means append at the end
    
    so, **cat amit.js somefile.js &gt; newfile.js**
    
    would create new file with contents of amit.js and somefile.js.
    
2. **grep : find strings within text files**
    
    **grep "something" filename.txt**
    
    would return places where it matches WITHIN FILE
    
    **grep "something" -R ./**
    
    will return all matching strings with files in current directory.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1672954513042/e98530f5-d350-4e61-8d49-20c8c8680f4e.png align="center")
