Skip to content

Instantly share code, notes, and snippets.

@kristijandraca
Last active February 28, 2022 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kristijandraca/9d871609881545ea1c2cd0aae86dad38 to your computer and use it in GitHub Desktop.
Save kristijandraca/9d871609881545ea1c2cd0aae86dad38 to your computer and use it in GitHub Desktop.
server commands cheat sheet
# Enable site config
a2ensite config_name.conf
# Disable site config
a2dissite config_name.conf
# Reload Apache2 config
systemctl reload apache2
# List all files and folders with permissions
ls -la
# Create a directory
mkdir directory_name
# Delete file
rm file
#Export mysql db
mysqldump -u USER_NAME -p DB_NAME >FILE_NAME.sql
# Remove the directory and its content
rm -r directory_name
# Copy file1 to file2
cp file1 file2
# Move / rename
mv file1 file2
# Show free and used space on mounted filesystems
df -h
# Copy something from another system to this system:
scp username@hostname:/path/to/remote/file /path/to/local/file
# Copy something from this system to some other system:
scp /path/to/local/file username@hostname:/path/to/remote/file
# Copy something from some system to some other system:
scp username1@hostname1:/path/to/file username2@hostname2:/path/to/other/file
#Archive something
7za a -t7z archive.7z file.txt
#Extract archive
7za x archive.7z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment