find Linux command tricks asked in exams and how to write

find Linux command tricks asked in exams and how to write

======================

A

The find Operators (!, -o, and -a)
There are three operators that are commonly used with find. The ! operator is used
before an option to negate its meaning. So,

find . ! -name "*.c" -print

selects all but the C program files.
B
To look for both shell and perl scripts, use the -o operator, which represents an OR condition. 
We need to use an escaped pair of parentheses here:
find /home \( -name "*.sh" -o -name "*.pl" \) -print

The ( and ) are special characters that are interpreted by the shell to run commands in
a group. The same characters are used by find to group expressions using the
-o and -a operators, the reason why they need to be escaped.
C
Also to find all *.sh (shell scripts) files for user tux execute:
find /home -user "tux" -name "*.sh" -print 
find /home -user "tux" -name "*.sh" -exec ls {} >| file.txt \; # write listing in file.txt 

these two commands  are equivalent to these two >>>

find /home \( -user "tux" -a -name "*.sh" \) -print
find /home \( -user "tux" -a -name "*.sh" \) -exec ls {} >| file.txt \; # write listing in file.txt 

I conclude in some commands use find for finding:

Directories with sticky bit set:
find / -type d -perm -1000 -exec ls -ld {} \;

Files with SGID set:
find / -type f -perm -2000 -exec ls -l {} \;

Files with SUID set:
find / -type f -perm -4000 -exec ls -l {} \;

Files with SUID and SGID set:
find / -type f \( -perm -4000 -a -perm -2000 \) -exec ls -l {} \;

Files with SUID or SGID set:
find / -type f \( -perm -4000 -o -perm -2000 \) -exec ls -l {} \;








































Note:
ALL THESE COMMANDS - IF NOT WORK - MAKE THE APPROPRIATE SPACING eg  \( -user "tux" like exactly I write

Further Reading Resources

https://likegeeks.com/linux-command-line-tricks/

Linux Distros for < ... >

Linux Distros for < … >

===========

Gaming

Steam OS – https://store.steampowered.com/steamos/

 ==================================================

Photography / Video Production / Graphic Designer

Ubuntu Studio – https://ubuntustudio.org/

 ==================================================

Programming / Soft Development

Semi Code (out of date) [Preinstalled Apps and Soft IDEs]

 ==================================================

Workstation User / Programmer / Coder

Fedora or Ubuntu or Linux Mint or Linux Arch or Antegros

 ==================================================

Ethical Hacking & Penetration

Kali Linux or Parrot Linux

// https://www.kali.org/ – https://www.parrotsec.org/

Kali Linux Cheat Sheet

 ==================================================

Consumer Web Server

CentOS 7 or Ubuntu Server or Debian – https://centos.org/ – https://www.debian.org/ – https://www.ubuntu.com/server

 ==================================================

Enterprise Server

RHEL 7 – https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux

or Ubuntu Server – https://www.ubuntu.com/server

 ==================================================

Linux with Windows like Desktop

Linux Mint – https://www.linuxmint.com/

 ==================================================

Linux with MacOS like Desktop

Elementary OS – https://elementary.io/

 ==================================================

Linux Foundation Exams LFCS , LFCE – https://www.linuxfoundation.org/

are available for

CentOS 7 Server or Ubuntu Server
– https://centos.org/ – https://www.ubuntu.com/server

=YOUTUBE========================

It doesn’t matter what kind of user you are, there exists a perfect Linux distro for you.

1. Best Linux Distro for Desktops and Powerful Laptops – Linux Mint, known to provide a near-to-perfect Linux desktop experience.

2. Best Linux Distro for Regular Laptop – Ubuntu MATE. Ubuntu comes with nine different flavours that have their own programs, features, and desktop environments.

3. Best Linux Distro for Older and Slow Hardware – Puppy Linux. It is ideal for the conditions where a compact distro due to older hardware and low computing resources.

4. Most Customizable Linux Distro – Arch Linux. It is a minimalistic Linux distro that allows your to start learning Linux from scratch. But, it is not recommended for the beginners as thereís a lot of command line work and manual configuration.

5. Most Beautiful Linux Distro – elementaryOS. The maker of this completely community-based OS are an expert in design and it is one of the prettiest Linux distributions you will come across.

6. Best Best Privacy-focused Linux Distro – Tails. It is a live operating system that you can boot on any computer from a USB stick, SD card, or DVD and used by the likes of Edward Snowden.

7. Best Linux for Ethical Hacking and Penetration Testing – Kali Linux. It is a special purpose Linux distro for pen testing and network security testing. With more than 600 tools, Kali Linux is designed to be used in a single, root user scenario due to security purposes.

8. Best Linux Distro For Servers – Debian. One of the longest running Linux distros, Debian, has served as a framework for many other distros like Mint and Ubuntu.

9. Best Linux Distro For IoT – Snappy Ubuntu Core. Focussing on Internet of Things application, Canonical released a Snappy version of Ubuntu Core OS for IoT.

10. Best Linux Distro For Video Editing and Multimedia Production – Ubuntu Studio. It fills an empty spot of a multimedia production-focused Linux distro. It comes with tools for recording, mixing, mastering, live processing, or even coding.

11. Best Linux Distro For Gaming – SteamOS. Honestly, there isn’t a Linux distro that is perfect for playing all kinds of game. With each passing day, more and more games are being officially released on Linux.

================================