You can use the following xdpyinfo command
xdpyinfo | grep dim
dimensions: 3840x3673 pixels (1016x971 millimeters)
You can use the following xdpyinfo command
xdpyinfo | grep dim
dimensions: 3840x3673 pixels (1016x971 millimeters)
You have two files (A.txt, B.txt) that contain records (one line each), and you want to find out the common lines between the two.
For example you have the following two files.
A.txt
one
two
three
and B.txt
two
six
seven
and you want to find or produce a new file (C.txt) that contains only the common record (two) from the two files.
You can use grep with the -Fx options like
grep -Fxf A.txt B.txt > C.txt
that will produce file C.txt that contains the common line (two) from the two files.
The options for grep have the following meaning:
-F
: Interpret the pattern as a list of fixed strings (instead of regular expressions).-x
: Only match whole lines.-f fileA.txt
: Read the patterns from fileA.txt
.It seems that the default email client in Fedora 40 is s-nail instead of mailx in Fedora 39, and trying to send an email from the command line does not work anymore.
The two changes required in order for the command to work with s-nail are:
s-nail: -a is an invalid alias name
So the full command can be like the following:
echo $body | mail -s "Reports for $yesterday" -a $report_path_a -a $report_path_b -c $cc_recipients $recipients
If you would like to convert an epub file to pdf in Linux, you can use calibre.
First install it using
sudo apt-get install calibre
and then you should be able to use it to convert the file like
ebook-convert file.epub file.pdf
To sort the files in a directory use the following
du -sh -- * | sort -h
Taken from https://unix.stackexchange.com/a/4682
When trying to use Nextcloud’s occ (ownCloud Console) command and it’s not possible to use sudo or su (installation on Debian GNU/Linux 11), you can try with the following command (you may have to change the paths to php and occ).
runuser --user www-data -- /usr/local/bin/php /var/www/html/occ user:list
This is quite possibly caused by one of the limits set too low. It is common when using promtail (with Loki for example) to tail log files.
One of the ways to get over this is to increase the value (in this example max_user_instances) either for the session or by making the change permanent by adding to a file (/etc/sysctl.conf).
For testing and doing it for the session, login to the affected server and do the following
ubuntu@server:~$ cat /proc/sys/fs/inotify/max_user_instances 128 ubuntu@server:~$ sudo sysctl fs.inotify.max_user_instances=8192 fs.inotify.max_user_instances = 8192 ubuntu@server:~$ cat /proc/sys/fs/inotify/max_user_instances 8192
To get the total number of open file descriptors use the following
awk '{print $1}' /proc/sys/fs/file-nr
Get the list of zombie processes:
ps aux | awk '{if($8=="Z") print}'
Get the parent process of each of the processes listed above (second column)
ps -o ppid= -p 490392
Kill the parent process from the above output
sudo kill -9 3167559
If you would like to split a large zip file with 7zip, in 1GB files for example, you can use the following
7z -v1g a documents_multipart.7z dir/