Basic Commands
lsb_release -a
shows all (thus the-a
) the LSB (Linux Standard Base) release information, including the versiontail -f error_log
nslookup alasnome.com
(get current IP address)mv src dest
(move/rename a file or dir)cp src dest
(copy a file or dir)cp -R src dest
(recursive copy, including hidden files)cp -u src dest
(update = copy if newer)rmdir some_dir
to remove empty directoryrm -r some_dir
(recurse) for non-emptychmod
(change privledges, use -R for recursive)chown
(change ownership)df
- disk free, get disk space used and availablels
(directory listing)ll
(alias forls -l
)cat filename
(concatenate to terminal)nano filename
(text editor)service apache2 stop
service apache2 start
shutdown -r now
(reboot the linux box)
Add/Remove Programs
dpkg -l | grep -i someapp
- find package nameapt-get update
(fetch updates)apt-get upgrade
(apply updates)
Create Users
useradd
is native binary compiled with the system- requires -m to create '/home/username' directory
adduser
is a perl script which uses useradd:- more user friendly and interactive than useradd
- automatically creates '/home/username' directory
man page for adduser
adduser
and addgroup
add users and groups to the system
according to options and configuration in /etc/adduser.conf.
They are friendlier front ends to the low level tools like useradd, groupadd and usermod programs, by default choosing policy conformant UID and GID values, creating a home directory with skeletal configuration, running a custom script, and other features.
adduser
and addgroup
can be run in one of five modes...
man page for useradd
:
useradd
is a low level utility for adding users.
Administrators should usually use adduser
.
Make the uploads folder writable
> cd /home/shanebow/public_html
> sudo chmod -R 775 uploads
> sudo chown shanebow uploads
Install JDK and IntelliJ
- See if java already installed:
java -version
or see How to Install Java on Ubuntu and Linux Mint - Install IntelliJ IDEA on Ubuntu and other Linux distributions
Install node.js and PM2
> curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
> curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
> sudo apt-get install -y nodejs
> node -v
v10.14.0
> sudo npm i -g npx
> sudo apt-get install -g pm2
Don't forget to make the server executable withsudo chmod 775 server.js