-
Notifications
You must be signed in to change notification settings - Fork 0
Ubuntu
sudo apt update && sudo apt upgrade && sudo apt autoremove -y && cat /var/run/reboot-required
only for current session:
alias apt-get="sudo apt-get"
permanently
sudo gedit ~/.bashrc
alias apt-get="sudo apt-get"
if after apt update command you see:
An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: ...
sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com
How To Add Swap Space on Ubuntu 18.04
chmod --reference=reference_file file
is the same:
chown --reference=reference_file file
#Execute sudo without password
echo "$USER ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/$USER
sudo chmod --reference /etc/sudoers.d/README /etc/sudoers.d/$USER
To limit log files to a specific size systemd provides a vacuum feature to "suck out" older information from log files.
journalctl --vacuum-size=200M
To archive:
> journalctl --disk-usage
Archived and active journals take up 136.0M on disk.
to set value a permanently:
set SystemMaxUse=200M
in /etc/systemd/journald.conf
file and restarts the service:
systemctl restart systemd-journald
Universal command to fix this issue for many different packages that have this issue:
sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com
grep -rnw '/path/to/somewhere/' -e 'pattern'
-r or -R is recursive, -n is line number, and -w stands for match the whole word. -l (lower-case L) can be added to just give the file name of matching files. -e is the pattern used during the search Along with these, --exclude, --include, --exclude-dir flags could be used for efficient searching:
This will only search through those files which have .c or .h extensions:
grep --include=\*.{c,h} -rnw '/path/to/somewhere/' -e "pattern"
This will exclude searching all the files ending with .o extension:
grep --exclude=\*.o -rnw '/path/to/somewhere/' -e "pattern"
For directories it's possible to exclude one or more directories using the --exclude-dir parameter. For example, this will exclude the dirs dir1/, dir2/ and all of them matching *.dst/:
grep --exclude-dir={dir1,dir2,*.dst} -rnw '/path/to/somewhere/' -e "pattern"
This works very well for me, to achieve almost the same purpose like yours.
How do I get back to nano after hitting Ctrl-Z
#List your jobs
jobs
#Bring a job to the foreground
fg 1