Skip to content

Instantly share code, notes, and snippets.

sahil@sahil-laptop:~$ git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
sahil@sahil-laptop:~$ curl -L -o book.txt https://raw.githubusercontent.com/bobdeng/owlreader/master/ERead/assets/books/Harry%20Potter%20and%20the%20Goblet%20of%20Fire.txt
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1113k 100 1113k 0 0 1653k 0 --:--:-- --:--:-- --:--:-- 1652k
sahil@sahil-laptop:~$ head -n 3 book.txt
Harry Potter and the Goblet of Fire
  By J.K. Rowling
sahil@sahil-laptop:~$ tail -n 10 book.txt
  and Goyle, who were still lying on the floor, covered in hex marks.
sahil@sahil-laptop:~$ hostname -I
192.168.1.102
sahil@sahil-laptop:~$ nslookup google.com | grep 'Address' | tail -n 1
Address: 2404:6800:4007:804::200e
sahil@sahil-laptop:~$ curl -Is https://www.google.com | head -n 1
HTTP/2 200
sahil@sahil-laptop:~$ which node
/usr/bin/node
sahil@sahil-laptop:~$ which code
/snap/bin/code
sahil@sahil-laptop:~$ sudo apt install htop vim nginx -y
[sudo] password for sahil:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
libllvm19
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
nginx-common vim-runtime
@GSAHIL27
GSAHIL27 / gist:e4cf72c9b8d4a40f003da25cfeb837e1
Created October 28, 2025 17:43
Processes and Ports Questions
sahil@sahil-laptop:~/CLI_Reports/week2$ ps -eo pid,ppid,cmd | grep firefox
3042 2271 /snap/firefox/6565/usr/lib/firefox/firefox
sahil@sahil-laptop:~/CLI_Reports/week2$ kill 3042
sahil@sahil-laptop:~/CLI_Reports/week2$ ps -eo pid,comm,%cpu --sort=-%cpu | head -n 4
PID COMMAND %CPU
46618 Isolated Web Co 7.3
45740 firefox 6.3
46719 Isolated Web Co 2.3
sahil@sahil-laptop:~/CLI_Reports/week2$ ps -eo pid,comm,%cpu --sort=-%cpu | head -n 3
PID COMMAND %CPU
Practice Drill 1
sahil@sahil-laptop:~$ mkdir -p hello/five/six/seven hello/one/two/three/four
sahil@sahil-laptop:~$ touch hello/five/six/c.txt hello/five/six/seven/error.log hello/one/a.txt hello/one/b.txt hello/one/two/d.txt hello/one/two/three/e.txt hello/one/two/three/four/access.log
sahil@sahil-laptop:~$ tree hello
Command 'tree' not found, but can be installed with:
sudo snap install tree # version 2.1.3+pkg-5852, or
sudo apt install tree # version 2.1.1-2
See 'snap info tree' for additional versions.
sahil@sahil-laptop:~$ sudo snap install tree