Friday, December 22, 2023

Difference between #BIOS and #UEFI for someone new to computers:


BIOS stands for Basic Input/Output System. It's like the computer's first language—it tells your computer how to start up when you press the power button. It's been around for a long time and works with older systems. Imagine it as an old, reliable but somewhat limited way of starting your computer.

UEFI stands for Unified Extensible Firmware Interface. It's like a newer and more versatile version of BIOS. UEFI does the same job as BIOS but in a more modern way. It's like upgrading from an older phone to a newer one with better features. UEFI is more flexible, faster, and can handle bigger and newer hard drives.

One key difference is that BIOS uses a simple text-based interface, while UEFI has a graphical interface that's easier to navigate. Also, UEFI supports more security features, like Secure Boot, which helps protect your computer from certain types of malware during startup.

So, think of BIOS as the old but reliable way your computer starts up, and UEFI as the newer, more advanced method that offers better features and security.

Thursday, December 21, 2023

How to i see list of only file and sort by type and see count of each type of files

find . -type f -printf "%f\n" | awk -F. '{print $NF}' | sort | uniq -c

  • find . -type f -printf "%f\n": This finds all files (-type f) in the current directory (.) and prints only their names (%f) followed by a newline.
  • awk -F. '{print $NF}': This uses awk to extract the file extensions by splitting each filename at the dot (.) and printing the last field ($NF).
  • sort: This sorts the file extensions alphabetically.
  • uniq -c: This counts the occurrences of each unique file extension.

This command will output a list showing the count of each file type in the current directory. Adjust the starting directory in the find command (. in this example) if you want to search in a different directory.

Display both head and tail of a file or a ls command output or anyother command

Following Commands will basically show head and tail of a command or a file at once, basically it will sho the start and end of a file or a command.

Combining head and tail using cat

    cat filename | head && echo "..." && cat filename | tail

Using sed command to display both head and tail:

    sed -n -e '1,10p' -e '$p' filename

To view both the head and tail of the output from an ls command, you can combine head and tail commands together with a pipe (|) to display both at the same time.

    ls -l | { head; echo "..."; tail; }

    ls -l > temp_file && { head temp_file; echo "..."; tail temp_file; } && rm temp_file


Featured Posts

#Linux Commands Unveiled: #date, #uname, #hostname, #hostid, #arch, #nproc

 #Linux Commands Unveiled: #date, #uname, #hostname, #hostid, #arch, #nproc Linux is an open-source operating system that is loved by millio...