Linux tips

How to copy files from multiple dirs to one place?
for example to want to copy the deb files from multiple directories to one directory, use this find command:
find /path/to/parent -name '*.deb' -exec cp -v --backup=numbered -t /path/to/newdir {} +
The --backup=numbered option will add a simple numbered suffix to each duplicate file.
How to start application in gui as diferrent user?
To run an application in gui as different user once run this command:
xhost +local:user_name
Then run this command:
sudo -u user_name -H application_name
How to give user read and write permission to other drives?
mount your drive to the /media/shams and add to the group adm with your drive uuid:
chgrp adm /media/shams/e46cafba-2656-4e42-b1c9-6417f28839 -R
Now give the read and write permission to group for this drive:
chmod g+rwx /media/shams/e46cafba-2656-4e42-b1c9-6417f28839 -R
Top


<< Previous Next >>