Files

View file contents

# View from start of file
cat file.txt

# View from end of file
tail -n 100 file.txt

Copy files

# Copy (recursive)
cp -r SOURCE DESTINATION

# Copy from local to server securely
# Example: scp hello.txt [email protected]:httpdocs
scp file.txt user@server:destination

# Copy from server to local securely
# Example: scp [email protected]:httpdocs/hello.txt .
scp user@server:path/to/file.txt .

# Move file to new directory
mv file.txt /path/to/new/destination/

Remove files

# Remove everything in current directory
rm *

# Remove everything in current directory + subfolders
rm -rf *