shows a manual page for that option. Like help
cd /etc/apt: where we store configuration files and various things related to configuration.
vi sources.list is a file telling anywhere we can get software.
- deb: Debian (Debra + -ian is surname of guy who built debian, from which ubuntu has modded itself)
sudo apt-get updategets us list of packages from repositories that i can install. A software updater will also see to let us know if any outdated software exist.
sudo apt-get upgrade actually installs the packages.
apt-get update updates the list of available packages and their versions, but it does not install or upgrade any packages. apt-get upgrade actually installs newer versions of the packages you have.
apt-cache search emacs searches for any software that says emacs. Relevant or irrelevant.
sudo apt-get install emacs vi postfix installs emacs, vi, postfix
sudo apt-get remove emacs removes only emacs. Not the other dependencies it installed along with emacs.
sudo apt-get autoremove searches for all packages that are not being used in some way and removes them.
Traditionally, the logger is called syslog. On linux/Ubuntu, the implementation is rsyslog.
.d stands for directory.
it's in /etc/rsyslog.d.The configuration is in rsyslog.conf. The conf file will tell where the logging is being done. Most likely /var/log
Services are the programs that run in the background.
Startup services are Found in /etc/init.d.
Run level services in /etc/rc3.d
You can run status on a service like sudo /etc/init.d/snbd status
or sudo service --status-all
We can start and stop services from here.
Process is a running instance of a program. It has a process entry in the process table.
ps: Process statistics
ps a: More details
ps eaf: Lots of details
ps aux: shows all processes running on system regardless of which user
top: Shows auto updating list of CPU process using processes.
get the process id by searching for something like ps aux | grep firefox and copy the process id. Now type kill <process number>
or killall firefox
or killall -9 firefox Kills process regardless of what state it is in.
- say you get a zip file of source code.
- Extract it
- go into the extracted directory
- Run
./configurescript that is provided in the package to make sure all components are in place to build software. - There exists a
makefilethat sets variables. don't bother with it - Next type
makewhich compiles and builds the software - Next type
sudo make install
grep: Global replace. Used to search string patterns in files.
ps aux | grep firefox: narrow down the results of ps aux to ones containing firefox.
The pipe | means take the output of first command and send it to the second one.
grep file *: search for the word 'file' among everything in the current directory but not deeper.
grep -r file * does recursive search into subfolders as well.
sed: Stream editor
echo this is true
echo this is true | sed 's/true/false/'
grep file * | sed 's/file/non-file/ replaces the first instance only. add /g at the end to replace all instances.
cat myfile | sed 's/file/foo/' > myfoo opens myfile but sends output to sed which replaces file with foo and then send this output to myfoo.