check available space
This command lists the file system showing used and available space. Add --total flag to display a sum of all resources at the bottom.
df -h
copy
This command lists the file system showing used and available space. Add --total flag to display a sum of all resources at the bottom.
df -h
copy
Copy file to the same directory. Put the name of the file you want to copy after the 'cp' command followed with the name of the new copied file.
cp file-to-copy.txt new-copied-file.txt
copy
Navigate to the directory you want your file to sit in. The command will create a file with a specified name.
touch your-new-file.js
copy
Open document in Nano editor.
nano file-to-edit.js
copy
Removes contents of a file but does not delete it.
cat /dev/null > file-to-wipe.txt
copy
Display all groups user belongs to.
groups user-name
copy
Htop is a useful tool for monitoring your system's performance. It displays CPU, RAM, and swap file usage. It also lists all of the running processes.
htop
copy
This command lists all sites enabled on the server.
apache2ctl -S
copy
Lists all installed packages in your Linux/Unix environment.
dpkg --list
copy
Creates a new directory using the second parameter as a name.
mkdir new-directory
copy
Adds executable permissions to a file.
chmod +x filename.html
copy
Move file to a different directory.
mv [file name] [new location]
// i.e.
mv file-to-move.js ./new/directory/for/the/file
copy
Move with all the files to a different directory.
mv folder-name/* /new/destination/folder/
copy
Login to MySQL. Put username after the -u flag and use -p flag to insert password.
mysql -u root -p
copy
Logout from MySQL.
quit
copy
Ping command lets you check the status of the domain name or an IP address
ping domain-to-ping.com
copy
This command lets you preview the contents of the file directly in the console.
cat file-to-preview.js
copy
Deletes file.
shred -uvz file-to-remove.txt
copy
This command will uninstall a given package with all the config files.
sudo apt-get --purge remove package-name
copy
Show latest entries from the system journal.
journalctl | tail
copy