Edited, memorised or added to reading queue

on 11-Feb-2019 (Mon)

Do you want BuboFlash to help you learning these things? Click here to log in or create user.

Flashcard 3819051814156

Question

In linux, complete the following command that finds all python files in current directory (and subdirectories below) and deletes them:

find . -name '*.py' [...]

Answer

find . -name '*.py' | xargs rm

^^ note the use of xargs (i.e. how xargs takes all the output from find, seperates it by whitespace/newline, and feeds it to the rm command, one by one, as command line args)


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
20. Advanced Shell Scripting
;& break done 20.7.5 Recursive grep (search) Recursively searching through a directory tree can be done easily with the find and xargs commands. You should consult both these man pages. The <span>following command pipe searches through the kernel source for anything about the ``pcnet'' Ethernet card, printing also the line number: find /usr/src/linux -follow -type f | xargs grep -iHn pcnet (You will n







Flashcard 3819134651660

Question
In linux, the bash script that gets run after EVERY new shell that is created (hence is good place to declare things like aliases) is: [...]
Answer

~/.bashrc

^^ note the rc here stands for "run command"


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
20. Advanced Shell Scripting
the case of bash , the files it reads are: /etc/profile , ~/.bash_profile , ~/.bash_login and ~/.profile , in that order. In addition, an interactive shell that is not a login shell also reads <span>~/.bashrc . Note that traditional sh shells only read /etc/profile and ~/.profile . 20.8.1 Customizing the PATH and LD_LIBRARY_PATH Administrators can customise things like the environment variab







Flashcard 3823462649100

Question
In linux, most services (like printing, docker containers, etc) have a client/server nature where a [...] is the server and is initiated by the root user, and the remaining commands are client programs, and are run mostly by users.
Answer
daemon/background service

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
21. System Services and lpd
program makes a network connection to the lpd background process, sending it the print job. lpd then queues, filters, and feeds the job until it appears in the print tray. Printing typifies the <span>client/server nature of UNIX services. The lpd background process is the server and is initiated by the root user. The remaining commands are client programs, and are run mostly by users. 21.2 Downloading and Installing The







Flashcard 3823466319116

Question
In linux, most daemon/service initialization scripts (for example for starting docker, jenkins, etc) are located in the [...] directory
Answer
/etc/init.d

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
21. System Services and lpd
c/printcap gives setup-2.3.4-1 , and dpkg -S /etc/printcap shows it to not be owned (i.e., it is part of the base system). 21.4.6 Service initialization files The files in /etc/rc.d/init.d/ (or <span>/etc/init.d/ ) are the startup and shutdown scripts to run lpd on boot and shutdown. You can start lpd yourself on the command-line with /usr/sbin/lpd but it is preferably to use the given script: /







Flashcard 3823470251276

Question
In linux, the [...] command/program manages the rotation of logs for most other programs/services.
Answer
logrotate

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
21. System Services and lpd
ives messages like: [Not all distributions log this information.] Jun 27 16:06:43 cericon lpd: lpd shutdown succeeded Jun 27 16:06:45 cericon lpd: lpd startup succeeded 21.4.9 Log file rotation <span>Log files are rotated daily or weekly by the logrotate package. Its configuration file is /etc/logrotate.conf . For each package that happens to produce a log file, there is an additional configuration file under /etc/logrotate.d/ . It is a







Flashcard 3823474707724

Question
In linux, most program logs are managed by logrotate, which runs via [...] on a daily basis
Answer
cron

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
How log rotation works with logrotate | Network World
, though logrotate itself is run through cron. The important files to pay attention to are: /usr/sbin/logrotate -- the logrotate command itself (the executable) /etc/cron.daily/logrotate -- the <span>shell script that runs logrotate on a daily basis (note that it might be /etc/cron.daily/logrotate.cron on some systems) /etc/logrotate.conf -- the log rotation configuration file Another important file is /etc/logrotate.d, included in







Flashcard 3823478377740

Question
In linux, log file rotation (managed by the logrotate command/program) serves what puposes?
Answer

1) It ensures the log file does not get too big/unmanagable.

2) It backs up certain older log files for history tracking and deletes really old ones to save space.


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
21. System Services and lpd
the lpd service gives messages like: [Not all distributions log this information.] Jun 27 16:06:43 cericon lpd: lpd shutdown succeeded Jun 27 16:06:45 cericon lpd: lpd startup succeeded 21.4.9 <span>Log file rotation Log files are rotated daily or weekly by the logrotate package. Its configuration file is /etc/logrotate.conf . For each package that happens to produce a log file, there is an addition







Flashcard 3823481523468

Question
In linux, the logrotate command/program (run as a cronjob) manages the rotation of different service/program logs (such as docker, jenkins, etc), and the log rotation strategy/configurations for each individual program are in seperate config files within the [...] directory
Answer
/etc/logrotate.d

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
How log rotation works with logrotate | Network World
grotate command itself (the executable) /etc/cron.daily/logrotate -- the shell script that runs logrotate on a daily basis (note that it might be /etc/cron.daily/logrotate.cron on some systems) <span>/etc/logrotate.conf -- the log rotation configuration file Another important file is /etc/logrotate.d, included in the process through this line in the /etc/logrotate.conf file: include /etc/logrotate







Flashcard 3823485979916

Question
In linux, any program that needs to be built from sources can employ a [...] to make things easier.
Answer

Makefile

^^ the Makefile is then run to create the program from source using the "make" command

^^^ Makefiles were originally used to compile C programs (since first .c file needs to be compiled to .o, linked with libraries, and then the final .out executable) but can be used for any program created in any language.


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
22. Trivial Introduction to C
l disconnected target clean: . Targets can be run explictly on the command-line like this: make clean which removes all built files. Makefile s have far more uses than just building C programs. <span>Anything that needs to be built from sources can employ a Makefile to make things easier. Next: 23. Shared Libraries Up: rute Previous: 21. System Services and Contents <span>