- OS version of system is stored in /etc/os-release
- [Command] - - > [SHELL] - - >(checks) - - > [PATH] - - > (interpretes) - - > [Kernel] - - > [ HDD ]
- Upon completion of all processes an exit code is created which defines that the command or program completed successfully ( if successfull - > exit code == 0 and if not successfull - > exit code != 0 )
- Python uses 'sh' shell for interpretation
- 'grep' stands for General Regular Expression
- Pipeline ( Pipe ) - - > Symbol '|' - - > Syntax { command1 | command2) - - > output of command1 is input to command2
- SCM - > Source Code Management - > differentiate programs with respect to code
- VCS - > Version Control System - > differentiate programs with respect to their versions
- Technologies using SCM are ~ : * SVN * Git / GITHUB { Git works on system level && GITHUB works on server side } * Bit Bucket
- what is cloning?- > downloading a repository from github
- Archive - > an unordered collection of data(files in a folder) - > no effect on size
- Compression - > an ordered/compact collection of data - > size reduces
- $ echo $PATH # gives the path of various directories where primitive commands are stored (Director1 : Directory2 : DirectoryN)
- $ wc -l file-name.extension # count no. of line in file
- $ wc -w file-name.extension # count no. of words in file
- $ wc -c file-name.extension # count no. of characters in file
- $ grep search-text where-to-search # finds the text with similar pattern
- $ grep -i search-text where-to-search # finds the text (Non-Case Sensitive)
- $ grep -w search-text where-to-search # find the text with exact word
- $ grep -v search-text where-to-search # find the text that doesn't match the search-text
- $ head -n file-name # extracts n lines from top of file
- $ tail -n file-name # extracts n lines from bottom of file
- $
command
file-name.txt # back quotes make command work if no space is given - $ tar -cvf new-file.tar file-name.extension # c - create ; v - visual ; f - forcefully , creates a archive
- $ ls -lh # shows file size in respective formats (kb/mb/gb)
- $ ls -l # shows file info ( size, permissions, name) , size in kb
- $ tar -tvf new-file.tar file-name.extension # shows the files present in archive
- $ tar -xvf new-file.tar # extracts all files out of tar/archive
- $ tar -czvf new.tar.gz file1.ext file2.ext # z- gzip , it commpreses the large files into size of Kbs
write your code and save it in /usr/bin example - - : vim /usr/bin/pykid
Redirection the output of a task/command to - - >
* File * E-Mail * Another System
* RAM * Printer * Whatsapp
* $ command > file-name.extension # overwrite, stores output of command in file
* $ command >> file-name.extension # append data, stores output of command in file
* $ command 2> file-name.extension # overwrite, stores output(error command) if an incorrect command is written
* $ command 2>> file-name.extension # append data, stores output(error command) if an incorrect command is written
('2>' it will run the command and show output on terminal if command is correct and nothing will be saved in file )
* $ command &> file-name.extension # sends the output of command either command is correct or not
* Based on Pipeline
* $ mail -s 'subject-for-mail' mail-id-of-receiver
Conditions for mail to be sent through this method are ~ :
1. Need a Public IP - - > its a unique and purchased IP taken from ISP
2. IP should be white-listed - - > any IP which visits porn sites or non-certified,dangerous sites is made non-white- listed
1. type the following command in receiver system # Host System
$ nc -l xxxx # nc stand for network connector and xxxx can have value from 0000 to 9999
2. type the following command in sender system # Sub Systems
$ nc IP-of-Host-System xxxx # xxxx have value set by host-system
- Commands -- > used only in Python 2
- os
- webbrowser
- subprocess
- Run application from terminal but it should not run from icon(GUI) { alter the name of code-file in /usr/bin (firefox to firefoxs) and set alias in bashrc for firefox to firefoxs (alias firefox='firefoxs') }
- How to Write Hello World in a Directory. { impossible, as a directory has no storage/memory of itself }
- Read about RAM { main memory,temporary, 2 types - SRAM nd DRAM, only data being used is stored }
- Find no. of lines in a file { file-handling in python, code saved in repo }
- Count no. of lines in a file without saving the file { input in terminal is saved in RAM, done, code i repo }
- open a browser-tab using python, find top 5 URLs and store them in list then open those 5 URLs and store top 5 in list again
- Redirect message from terminal to whatsapp