Linux Commands

Quick docker container to have a hoon

1
2
docker run -ti --name ubuntu-c ubuntu
docker start -i ubuntu-c

Update & Upgrade

pt-get update downloads the package lists from the repositories and “updates” them to get information on the newest versions of packages and their dependencies.

apt-get upgrade will fetch new versions of packages existing on the machine if APT knows about these new versions by way of apt-get update

1
2
3
4
5
6
7
8
9
10
11
apt-get update
apt-get upgrade

--- Install application `zip` & `unzip`. Check version and example use.
apt-get install zip unzip
zip --version
unzip content.zip

--- applications
python3, python
nano

Misc Commands and magic

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--- Misc Commands

ll ~ list files (simliar to DIR)
la ~ list files horizontally
rm -r [DIRECTORY NAME] ~ delete directory
rm -fm [DIRECTORY NAME] ~ delete directory with files in it
mkdir [DIRECTORY NAME] ~ create directory
sudo ./sbin/shutdown -r now ~ reboot
sudo ./sbin/shutdown -h now ~ omit now to schedule a shutdown
sudo -i ~ switch to the root user

--- Hardware Related

htop ~ system-monitor process-viewer and process-manager
top ~ this is like the windows task manager
grep -c ^processor /proc/cpuinfo ~ CPU core count
free -m ~ displays memory usage

Text Editor

1
2
3
nano postgres.sh                 ~ edit and create the file
chmod +x postgres.sh ~ mark as executable
./postgres.sh ~ runs the script
1
2
3
vm foo.txt
ESC : wq ~ save and exit
ESC : q! ~ exit dont save