๐ŸŒš
W3LC0M3
  • ๐Ÿ‘จโ€๐ŸณWelcome
  • ๐Ÿ–ฒ๏ธHacker Boy
    • ๐Ÿดโ€โ˜ ๏ธCTF's (challenges)
      • Crypto
        • Links
      • Pwn
        • Concepts
        • Links
        • Tryhackme: Intro to pwntools notes
      • Forensics
        • Volatitily
    • ๐ŸTryhackMe
      • Boxes
        • ๐Ÿ‘„biteme
    • ๐Ÿ“ฆHackTheBox
      • Challenges
        • Templated
        • Phonebook
        • Weather App
        • LoveTok
        • Toxic
      • Boxes
    • ๐Ÿค–Android Hacking
      • Hacking Android Notes
      • Android Hacking 101 - Tryhackme Notes
      • Tools
      • Useful Commands
      • Android Books
      • Hack the box - Mobile Challenges Notes
        • Don't Overreact Challenge Notes
      • Hacker101 Android Challenges notes
      • Crackme Challenge Notes
      • Android Application Basics Notes
      • Other References
    • ๐ŸชŸWindows PenTest Notes
    • ๐Ÿฆนโ€โ™‚๏ธServices Pentest Notes
    • ๐Ÿ““Vuln notes
    • ๐ŸงฐMy Pentest Tools
  • ๐Ÿ™‰Learny Boy
    • ๐Ÿ‘จโ€๐ŸซMy Projects
      • โ›๏ธMinero
        • Links
      • ๐ŸšRice
        • Debian Ricing
        • Shell
    • ๐Ÿง‘โ€๐Ÿš€Learning Stuff...
      • ๐ŸงLinux Fundamentals
      • ๐ŸŽ‡Network Enumeration with nmap
      • ๐Ÿ’พBinary Reverse Engineering
        • ๐Ÿ‡ฌ๐Ÿ‡ฎReverse Engineering with Ghidra
          • ๐Ÿฆ†Evil Duck Hunt
Powered by GitBook
On this page
  • Find Files
  • File Descriptors
  • Find How Many logs files are on the system
  • Find How Many packages are on the system
  1. Learny Boy
  2. Learning Stuff...

Linux Fundamentals

Find Files

  • What is the name of the config file that has been created after 2020-03-03 and is smaller than 28k but larger than 25k?

find / -type f -name *.conf -newermt 2020-03-03 -size +25k -size -28k 2>/dev/null
  • What is the name of the config file that has been created after 2020-03-03 and before 2020-03-05

find / -type f -name *.conf -newermt 2020-03-03 ! -newermt 2020-03-05 2>/dev/null

File Descriptors

A file descriptor (FD) in Unix/Linux operating systems is an indicator of connection maintained by the kernel to perform Input/Output (I/O) operations. In Windows-based operating systems, it is called filehandle. It is the connection (generally to a file) from the Operating system to perform I/O operations (Input/Output of Bytes). By default, the first three file descriptors in Linux are:

  1. Data Stream for Input

    • STDIN โ€“ 0

  2. Data Stream for Output

    • STDOUT โ€“ 1

  3. Data Stream for Output that relates to an error occurring.

    • STDERR โ€“ 2

Example: 2>/dev/null This way, we redirect the resulting errors to the "null device," which discards all data. We can redirect the valid output to a file with 1>results.txt.

Find How Many logs files are on the system

#!/bin/bash
FILES=$(find / -type f -name *.log 2>/dev/null)
COUNTER=0
for f in $FILES
do
        echo $f
        let COUNTER++
done
echo $COUNTER

Find How Many packages are on the system

dpkg -l | grep -c '^ii'
PreviousLearning Stuff...NextNetwork Enumeration with nmap

Last updated 2 years ago

๐Ÿ™‰
๐Ÿง‘โ€๐Ÿš€
๐Ÿง