Create python3 virtual env
python3 -m venv env
Claire Keane

Love Begins
h
wallacepolsom
No title available
Aqua Utopia|海の底で記憶を紡ぐ

roma★
ojovivo
trying on a metaphor
Monterey Bay Aquarium
Mike Driver
Acquired Stardust
d e v o n

No title available
I'd rather be in outer space 🛸
Keni
YOU ARE THE REASON
Game of Thrones Daily
art blog(derogatory)

祝日 / Permanent Vacation

seen from Malaysia

seen from Japan

seen from United States
seen from Germany

seen from Brazil
seen from United Kingdom

seen from Malaysia

seen from United States

seen from Singapore

seen from Hong Kong SAR China

seen from Germany

seen from China
seen from Spain
seen from Malaysia

seen from Malaysia
seen from Poland
seen from South Africa

seen from United States

seen from Spain

seen from United Kingdom
@linuxcommandsiuse
Create python3 virtual env
python3 -m venv env
Check free disk space
df -h
Git favourites
Following are my git favourites:
Show a tree graph view won the terminal.
git log --graph --decorate
Git files that changed in a commit.
git show --stat --oneline <hash>
Show commit logs.
git log --oneline
Show difference between commits with changes.
git diff-tree -cc
Show git log with changes.
git log --cc
List of authors who committed to a repo
git shortlog -s -n --all --no-merges
How to find the unix os information
cat /etc/os-release
Check linux flavour
Usecase: Check the linux flavour
Command:
cat /proc/version
Also proc has a great set of other commands. Check what's available by doing
ls /proc/
zip directory
Usecase Zip the current directory and create the zip file in the parent folder
Command
zip -r ./../filename.zip .
Example
zip -r ./../dummy.zip .
Find if the process running the command
ps cax | grep nginx
Find the process using a port
Following options show the process using port 80
netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
sudo netstat -nlp | grep :80
lsof - list open files
sudo lsof -i :80 | grep LISTEN
Start ssh-agent
Do the following in a command window to start the ssh agent service.
eval `ssh-agent -s`
scp
Usecase: Copy file from local computer to remote using SSH
Command:
scp [options] username1@source_host:directory1/filename1 username2@destination_host:directory2/filename2
apt-get update/upgrade
Usecase: Update linux packages
Commands:
sudo apt-get update # Fetches the list of available updates
sudo apt-get upgrade # Strictly upgrades the current packages
sudo apt-get dist-upgrade # Installs updates (new ones)
meminfo
Usecase: When I need to check memory on the machine
Command: egrep --color 'Mem|Cache|Swap' /proc/meminfo
or
free -m
English: Gives a color column output of memory usage.
setfacl
Usecase: When you need to define access rights to files and folders for more than one user group.
Command: setfacl -m <rules> <files>
Usage: setfacl -m g:mygroup:rwx /var/somefolder
English: Give user group mygroup read, write and execute access to the folder /var/somefolder
netstat
Usecase: Find the program using a given port
Command: netstat -tulpn | grep :<port>
Usage: netstat -tulpn | grep :80
English: Who is using port 80
su
Usecase: When I have multiple users and I want to switch from one to antoher:
Command: su <username>
Usage: su jerome. This will prompt you to enter the user password. Once you do that, the terminal session will be as that user
nohup
Usecase: When you have a program running in the terminal and exits if you close the terminal.
Command: nohup
Usage: nohup ./someserverapp/bin/start.sh > /var/log/someserver-hohup.out&
English: Run the server start script and redirect the console out to the location I have given